-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Add pagination support to various OpenAPI operations #2520
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
WalkthroughPagination metadata was added to several OpenAPI operation objects for commissions, customers, folders, and tags by introducing the Changes
Poem
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
♻️ Duplicate comments (4)
apps/web/lib/openapi/customers/get-customers.ts (2)
12-29
: Same duplication caveat as inget-tags.ts
The pagination block is byte-for-byte identical; centralise it to keep specs DRY.
16-24
: Confirm location string (“parameters”) is correctSee earlier comment in
get-tags.ts
.apps/web/lib/openapi/commissions/list-commissions.ts (1)
12-29
: Repeated pagination literalRefer to the suggestion in
get-tags.ts
for extracting a shared constant.apps/web/lib/openapi/folders/list-folders.ts (1)
12-29
: Repeated pagination literalRefer to the suggestion in
get-tags.ts
for extracting a shared constant.
🧹 Nitpick comments (1)
apps/web/lib/openapi/tags/get-tags.ts (1)
9-26
: Consider extracting the pagination descriptor to a shared constantThe exact same
"x-speakeasy-pagination"
object appears in four different operation specs. Duplicating the literal increases maintenance cost (e.g., if the parameter names ever change, every file must be touched).- "x-speakeasy-pagination": { - type: "offsetLimit", - inputs: [ - { name: "page", in: "parameters", type: "page" }, - { name: "pageSize", in: "parameters", type: "limit" }, - ], - outputs: { results: "$" }, - }, + // Share one canonical definition instead of repeating the literal + "x-speakeasy-pagination": OFFSET_LIMIT_PAGINATION,where
OFFSET_LIMIT_PAGINATION
could live in@/lib/openapi/pagination.ts
and be imported wherever needed.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
apps/web/app/api/folders/route.ts
(0 hunks)apps/web/lib/openapi/commissions/list-commissions.ts
(1 hunks)apps/web/lib/openapi/customers/get-customers.ts
(1 hunks)apps/web/lib/openapi/folders/list-folders.ts
(1 hunks)apps/web/lib/openapi/tags/get-tags.ts
(1 hunks)
💤 Files with no reviewable changes (1)
- apps/web/app/api/folders/route.ts
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: build
🔇 Additional comments (1)
apps/web/lib/openapi/tags/get-tags.ts (1)
12-21
:✅ Verification successful
Verify the
"in": "parameters"
value is accepted by SpeakeasySpeakeasy’s examples typically use
"in": "query"
to indicate query-string parameters. If"parameters"
is a project-specific alias that Speakeasy understands, ignore this; otherwise, generated SDKs may be missing the paging arguments.Run the following to grep for other uses and confirm what value the codebase expects:
🏁 Script executed:
#!/bin/bash # Inspect existing pagination descriptors for consistency rg -A2 -B2 '"x-speakeasy-pagination"' | head -n 40Length of output: 2238
🏁 Script executed:
#!/bin/bash # Show pagination inputs in get-tags.ts rg -n '"x-speakeasy-pagination":' -A10 -B3 apps/web/lib/openapi/tags/get-tags.ts # Show pagination inputs in get-customers.ts for comparison rg -n '"x-speakeasy-pagination":' -A10 -B3 apps/web/lib/openapi/customers/get-customers.tsLength of output: 930
No change needed: “in”: “parameters” is the correct Speakeasy alias
All existing pagination descriptors in your codebase (e.g.,
getCustomers
,listFolders
, etc.) consistently use"in": "parameters"
. This is a Speakeasy-specific shorthand for query‐string parameters and will be recognized by the SDK generator—no update to"query"
is required.
🤖 Bug0 QA Agent Here are the results of the automated tests for PR #2520:
To re-run the tests, please comment |
Summary by CodeRabbit