Skip to content

feat: every list paged by cursor has generated Pages and All iterators - #18

Merged
MarkRosemaker merged 2 commits into
mainfrom
feat/generated-iterators
Nov 15, 2026
Merged

MarkRosemaker merged 2 commits into
mainfrom
feat/generated-iterators

Conversation

@MarkRosemaker

Copy link
Copy Markdown
Contributor

openapi-codegen now generates XPages and XAll for every operation whose list is paged through by cursor (MarkRosemaker/openapi-codegen#77, #78), built on go-api-libs/api's paging. So iterators.go goes, and notion has iterators for 14 lists instead of 3:

users · block children · data source queries · data source templates · search · comments · file uploads · custom emojis · views · view query results · agents · skills plugins · sessions · session events

What notion's spec does for it:

  • A list whose start_cursor is a query parameter, which notion types as a UUID, now gives its next_cursor as a UUID too. That makes users match, and generalizes the rule block children already had.
  • A data source's templates are named as its list's items by x-pagination, since no other list calls them templates.

Changed for callers:

  • GetBlockChildrenAll takes *GetBlockChildrenParams, as GetBlockChildren does.
  • The iterators no longer force a page size of 100; Notion's default is 100 anyway. A caller's own page size is now sent with every page.

Not covered: RetrieveAPageProperty has no iterators. It answers with either one property item or a list of them, so there's no single list to page through.

Tests. The iterator tests page through the generated methods and check that a page size the caller passes is sent with every page. That shows the caller's params and body are copied, not changed. Coverage is 80.6%.

make ready passes.


Generated by Claude Code

openapi-codegen now generates XPages and XAll for each operation whose list is
paged through by cursor, so iterators.go goes: users, block children, queries,
templates, searches, comments, file uploads, custom emojis, views and their
results, agents, plugins, sessions and their events each have both. A list
whose start_cursor is a query parameter, a UUID, gives the cursor of its next
page as one, so the users' match, and a data source's templates are named as
its list's items by x-pagination. The iterator tests page through the generated
methods, with the caller's page size on every page.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019QCb1AfnATvpBQCH3PrX7Y
@MarkRosemaker
MarkRosemaker merged commit ca0f838 into main Nov 15, 2026
1 check passed
@MarkRosemaker
MarkRosemaker deleted the feat/generated-iterators branch November 15, 2026 12:02
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