Skip to content

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

Closed
takassh wants to merge 2 commits into
mainfrom
fix/issue-22-error-handling
Closed

takassh wants to merge 2 commits into
mainfrom
fix/issue-22-error-handling

Conversation

@takassh

@takassh takassh commented Mar 12, 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 commented Mar 31, 2026

Copy link
Copy Markdown
Owner Author

close because the branch name is wrong.

@takassh takassh closed this Mar 31, 2026
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