Commit 116376a
Continue cursor pagination until results are empty (#3474)
* Continue cursor pagination until results are empty
Mirror DataDog/datadog-api-client-go#3769: when an endpoint uses cursor-based pagination, keep requesting pages until the server returns an empty result set instead of stopping at the first page smaller than the requested limit.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* Also stop cursor pagination when next cursor is missing
If the response omits the next-cursor field (or returns it empty/null), there is no way to fetch a further page, so the loop should terminate even when the current page still has results.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>1 parent 0b32005 commit 116376a
2 files changed
Lines changed: 24 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
350 | 350 | | |
351 | 351 | | |
352 | 352 | | |
353 | | - | |
| 353 | + | |
| 354 | + | |
354 | 355 | | |
355 | | - | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
356 | 360 | | |
357 | 361 | | |
358 | 362 | | |
| |||
651 | 655 | | |
652 | 656 | | |
653 | 657 | | |
654 | | - | |
| 658 | + | |
| 659 | + | |
655 | 660 | | |
656 | | - | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
657 | 665 | | |
658 | 666 | | |
659 | 667 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
357 | 357 | | |
358 | 358 | | |
359 | 359 | | |
360 | | - | |
| 360 | + | |
| 361 | + | |
361 | 362 | | |
362 | | - | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
363 | 367 | | |
364 | 368 | | |
365 | 369 | | |
| |||
659 | 663 | | |
660 | 664 | | |
661 | 665 | | |
662 | | - | |
| 666 | + | |
| 667 | + | |
663 | 668 | | |
664 | | - | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
665 | 673 | | |
666 | 674 | | |
667 | 675 | | |
| |||
0 commit comments