Skip to content

fix: use snake_case serde for Todoist API v1 compatibility#1

Merged
sionsmith merged 2 commits intomainfrom
fix/serde-snake-case-api-v1
Apr 15, 2026
Merged

fix: use snake_case serde for Todoist API v1 compatibility#1
sionsmith merged 2 commits intomainfrom
fix/serde-snake-case-api-v1

Conversation

@sionsmith
Copy link
Copy Markdown
Contributor

Summary

  • The Todoist API v1 (/api/v1) returns snake_case field names (project_id, next_cursor) but all serde structs used rename_all = "camelCase", causing td sync to fail with missing field 'projectId'
  • Removed camelCase rename from all 21 model, request, and pagination structs across td-api
  • Added serde alias attributes for fields with ambiguous names across API versions (e.g., child_order/order, checked/is_completed) and #[serde(default)] for resilience against missing fields

Test plan

  • All 33 existing tests pass (cargo test)
  • cargo build succeeds
  • Manual verification: td sync now completes successfully (173 tasks, 3 projects, 16 sections, 2 labels)

🤖 Generated with Claude Code

sionsmith and others added 2 commits April 15, 2026 21:22
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>
@sionsmith sionsmith merged commit 7f62681 into main Apr 15, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant