Skip to content

feat: migrate to Notion API 2026-03-11 (and 2025-09-03) - #34

Merged
takassh merged 4 commits into
mainfrom
feature/migrate-2026-03-11
Apr 1, 2026
Merged

takassh merged 4 commits into
mainfrom
feature/migrate-2026-03-11

Conversation

@takassh

@takassh takassh commented Mar 31, 2026 •

Copy link
Copy Markdown
Owner

Summary

Migrates the client to support Notion API versions 2025-09-03 and 2026-03-11, implementing all breaking changes from both upgrade guides.

2025-09-03 changes

  • New DataSourcesEndpoint with create, retrieve, update, and query operations at /v1/data_sources/*
  • New DataSource object (analogous to Database but for multi-source databases)
  • Parent enum: added DataSourceId variant (data_source_id) alongside existing DatabaseId
  • RelationPropertyValue: added data_source_id field (API returns both IDs for convenience; responses keep database_id too)
  • Search FilterValue: added DataSource variant so callers can filter search results by data source
  • Search PageOrDatabase: added DataSource variant to handle data source objects in search results

2026-03-11 changes

  • archived → in_trash on Page, Database, Block, UpdatePagePropertiesRequest, and all test fixtures
  • AppendBlockChildren: replaced after: Option<String> with position: Option<AppendPosition> (supports End, Start, AfterBlock)
  • MeetingNotes block type added (renamed from transcription)
  • API version header updated to 2026-03-11

Fixes found during migration review

  • All JSON test fixtures still referenced "archived" — updated to "in_trash" (tests were silently skipping the field via serde unknown-field tolerance)
  • UpdateADataSourceRequest was missing #[skip_serializing_none], causing null fields to be serialized
  • synced_from_block.json and search_by_title_failure_with_missing_unique_id.json had both "archived" and "in_trash" in the same object (Notion API transition period); deduplicated to "in_trash" only

Test plan

  • All 44 existing tests pass (cargo test)
  • Build compiles cleanly (cargo build)
  • Manual smoke test against live Notion API with version 2026-03-11

🤖 Generated with Claude Code

takassh and others added 2 commits March 12, 2026 03:47
Implements breaking changes from both upgrade guides:

2025-09-03:
- Add DataSourceId variant to Parent enum
- Add DataSourcesEndpoint with create/retrieve/update/query operations
- Add DataSource object
- Add data_source_id to RelationPropertyValue (alongside database_id)
- Add DataSource variant to search FilterValue and PageOrDatabase response

2026-03-11:
- Rename archived → in_trash across Page, Database, Block, and update requests
- Replace after: String with position: AppendPosition in AppendBlockChildren
- Add MeetingNotes block type (renamed from transcription)
- Update Notion API version header to 2026-03-11
- Fix UpdateADataSourceRequest to use skip_serializing_none
- Update all test fixtures to use in_trash

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@takassh takassh closed this Mar 31, 2026
@takassh
takassh deleted the feature/migrate-2026-03-11 branch March 31, 2026 08:41
@takassh
takassh restored the feature/migrate-2026-03-11 branch March 31, 2026 08:43
@takassh takassh reopened this Mar 31, 2026
claude added 2 commits March 31, 2026 08:50
Move DateOrDateTime enum to property.rs and update DatePropertyValue.start/end
to use Option<DateOrDateTime> instead of DateTime<Utc>, so Mention::Date can
deserialize date-only strings like "2025-06-18" from Notion API responses.

Fixes #33

https://claude.ai/code/session_01S5wxBMpq6XBJQg3P51UeZ8
@takassh
takassh merged commit 550163e into main Apr 1, 2026
2 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.

2 participants