Repository navigation
Conversation
`--page-all` only continued when the response had `nextPageToken`, which this API does not use, so list commands exited 0 after a single page. Follow the pagination fields each operation documents, and exit non-zero when a later page fails or `has_more` is true without a token. Fixes elevenlabs#138
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.
Fixes #138
--page-allis documented as fetching every page, but it issued a single request and exited 0. The pagination loop only continues when it can read a next-page token fromnextPageTokenand send it back aspageToken. This API does not use those names, and the spec does not setx-fern-pagination, so every list response was treated as the last page.voices searchreturned the first page withhas_more: true.history listdid the same, and that response has no cursor field at all (last_history_item_idis whatstart_after_history_item_idexpects).--page-allnow follows the pagination fields declared on each operation:next_page_tokencursor/next_cursorstart_after_history_item_id/last_history_item_idlast_doc/next_docpage(withhas_more, ormeta.totalwhen the response has no cursor)offset/page_sizeIf a later page fails, or the response says
has_moreis true but does not include a token we can send, the command exits non-zero and says the results are incomplete. Hitting--page-limitis still a normal stop.Tests use a mock server and do not need an API key.
cargo test --test pagination_testcovers each pagination shape, including a failure on the second page.cargo test --lib openapi::pagination::testschecks every paginated operation in the spec.