Repository navigation
feat: every list paged by cursor has generated Pages and All iterators - #18
Merged
Merged
Conversation
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
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019QCb1AfnATvpBQCH3PrX7Y
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.
openapi-codegen now generates
XPagesandXAllfor every operation whose list is paged through by cursor (MarkRosemaker/openapi-codegen#77, #78), built on go-api-libs/api'spaging. Soiterators.gogoes, 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:
start_cursoris a query parameter, which notion types as a UUID, now gives itsnext_cursoras a UUID too. That makes users match, and generalizes the rule block children already had.x-pagination, since no other list calls themtemplates.Changed for callers:
GetBlockChildrenAlltakes*GetBlockChildrenParams, asGetBlockChildrendoes.Not covered:
RetrieveAPagePropertyhas 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 readypasses.Generated by Claude Code