-
Notifications
You must be signed in to change notification settings - Fork 475
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
Automatic pagination that continues until exhaustion #2908
Comments
Thanks @joshuaclayton for your issue. We need plenty of examples to see how it could work. |
With
We initiate the variable
In summary, we could use
|
Another, better, syntax for
|
One possible solution is to use For example, using
|
Problem to solve
Chained requests require explicit declaration, which makes pagination through an unknown page size untenable.
Proposal
The simplest example would be to wholesale swap URLs based on presence of a capture without any additional modification. This would allow for simple asserts / body capture decoupled from raw values and instead based on structure (e.g. presence of a field in a JSON response). Asserting against raw values likely wouldn't make sense for anything dynamic given generic pagination.
In that case, an additional section might work:
Other approaches might include more specific data capture (e.g. parsing
page=5
from theLink
header for the correct page, or querying the JSON response if that's where pagination info sits).Additional context and resources
Specific use case: data extraction (rather than response assertion) against paginated resources of unknown size.
I'd looked to see if there was any functionality around looping within the grammar and didn't find anything, and while I understand it may be possible to use JSON output + shell +
jq
or similar to initiate chaining, in an ideal world there'd be a mechanism for this within the grammar itself.The text was updated successfully, but these errors were encountered: