fix: use snake_case serde for Todoist API v1 compatibility#1
Merged
Conversation
The Todoist API v1 (/api/v1) returns snake_case field names (e.g., project_id, next_cursor) but all model and request structs used `#[serde(rename_all = "camelCase")]`, causing deserialization failures with "missing field `projectId`" errors on sync. - Remove camelCase rename from all model, request, and pagination structs - Add serde aliases for fields with ambiguous API names across versions (e.g., child_order/order, checked/is_completed, responsible_uid/assignee_id) - Add `#[serde(default)]` on optional fields for resilience - Fix camelCase query params in comments endpoint - Update test mock JSON to use snake_case Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The pinned SHA of dtolnay/rust-toolchain requires an explicit `toolchain: stable` input — the comment `# stable` alone is not sufficient. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/api/v1) returns snake_case field names (project_id,next_cursor) but all serde structs usedrename_all = "camelCase", causingtd syncto fail withmissing field 'projectId'camelCaserename from all 21 model, request, and pagination structs acrosstd-apialiasattributes for fields with ambiguous names across API versions (e.g.,child_order/order,checked/is_completed) and#[serde(default)]for resilience against missing fieldsTest plan
cargo test)cargo buildsucceedstd syncnow completes successfully (173 tasks, 3 projects, 16 sections, 2 labels)🤖 Generated with Claude Code