Skip to content

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

Merged
nogates merged 1 commit intomasterfrom
nogates/cursor-pag-empty-break
May 5, 2026
Merged

Allow cursor-based pagination to query extra page until collection is empty#3790
nogates merged 1 commit intomasterfrom
nogates/cursor-pag-empty-break

Conversation

@nogates
Copy link
Copy Markdown
Contributor

@nogates nogates commented May 5, 2026

Summary

Mirrors datadog-api-client-go#3769 for the Java client.

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.

  • New cursorPagination flag plumbed through PaginationIterable/PaginationIterator (and the matching .j2 templates).
  • Generator template Api.j2 passes pagination.cursorParam into the constructor.
  • Regenerated 31 API classes (50 new PaginationIterable(...) call sites).

The supporting cassettes (extra trailing {"data":[]} response) were already added in #3559 when the Go/Ruby clients shipped this change.

Test plan

  • mvn clean compile succeeds
  • All @with-pagination Cucumber scenarios pass (37/37)

🤖 Generated with Claude Code

… empty

Mirrors DataDog/datadog-api-client-go#3769. Cursor paginators now keep
querying until the response data is empty, instead of stopping when a
page returns fewer items than the requested limit.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@nogates nogates requested review from a team as code owners May 5, 2026 10:44
@nogates nogates added the changelog/no-changelog Changes don't appear in changelog label May 5, 2026
@nogates nogates merged commit 05ecea1 into master May 5, 2026
21 of 22 checks passed
@nogates nogates deleted the nogates/cursor-pag-empty-break branch May 5, 2026 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/no-changelog Changes don't appear in changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants