Skip to content

Allow cursor-based pagination to query extra page until collection is empty#1607

Merged
nogates merged 2 commits into
masterfrom
nogates/mirror-retry-config
May 18, 2026
Merged

Allow cursor-based pagination to query extra page until collection is empty#1607
nogates merged 2 commits into
masterfrom
nogates/mirror-retry-config

Conversation

@nogates
Copy link
Copy Markdown
Contributor

@nogates nogates commented May 18, 2026

What does this PR do?

Mirrors datadog-api-client-go#3769 and datadog-api-client-java#3790 for the Rust client.

Cursor-based paginators now keep querying until the response collection is empty (count == 0), instead of stopping early when a page returns fewer items than the requested limit (count < page_size). Page-offset and page-number paginations keep their existing behavior. The generator template (api.j2) conditionally emits the appropriate stop condition based on whether cursorParam is present, and all 13 affected generated API files (24 cursor-based pagination functions) have been updated accordingly. Test cassettes already had the trailing {"data":[]} responses pre-staged.

Additional Notes

Compiles cleanly with cargo check.

Review checklist

Please check relevant items below:

  • This PR includes all newly recorded cassettes for any modified tests.

  • This PR does not rely on API client schema changes.

    • The CI should be fully passing.
  • Or, this PR relies on API schema changes and this is a Draft PR to include tests for that new functionality.

    • Note: CI shouldn't be run on this Draft PR, as its expected to fail without the corresponding schema changes.

… empty

Cursor-based paginators now keep querying until the response collection
is empty, instead of stopping early when a page returns fewer items than
the requested limit. Page-offset and page-number paginations keep their
existing behavior. Mirrors datadog-api-client-go#3769 and
datadog-api-client-java#3790.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@nogates nogates requested review from a team as code owners May 18, 2026 11:09
Copy link
Copy Markdown
Member

@MintsInc MintsInc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nogates nogates merged commit 3456937 into master May 18, 2026
11 of 12 checks passed
@nogates nogates deleted the nogates/mirror-retry-config branch May 18, 2026 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants