Skip to content
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

Add information about default pagination to REST API documentation. #9194

Open
2 tasks done
codydirks opened this issue Mar 10, 2025 · 4 comments
Open
2 tasks done

Add information about default pagination to REST API documentation. #9194

codydirks opened this issue Mar 10, 2025 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@codydirks
Copy link

Actions before raising this issue

  • I searched the existing issues and did not find anything similar.
  • I read/searched the docs

Is your feature request related to a problem? Please describe.

The current API docs don't make it clear that some GET requests (i.e. /api/tasks, and probably others) will paginate results with a default page size of 10, rather than returning all results in a single request as a user might naively expect.

Describe the solution you'd like

Updated documentation to reflect the default pagination behavior, for any API endpoint that returns an array of results.

Alternatively, but probably a more involved change, would be to add a parameter that allows a user to override the default pagination and return all results if they so desire.

Describe alternatives you've considered

No response

Additional context

No response

@codydirks codydirks added the enhancement New feature or request label Mar 10, 2025
@demoncoder-crypto
Copy link

I would love to work on this. Could you please assign me.

@zhiltsov-max
Copy link
Contributor

zhiltsov-max commented Mar 14, 2025

Hi, we have a topic covering this in low level SDK API docs, as well as a utility function to request all pages. In the server API docs (e.g. here or in Swagger) we have parameter lists with available query parameters (including page and page_size), and endpoints with paginated output can typically be determined by the response schema description having count, prev, next, and page results array. Almost all endpoints that potentially can return an unlimited number of items return a paginated response. Returning all results in a single response is only available in development deployments.

@codydirks
Copy link
Author

Would it at least be possible to denote the default value of page_size in those docs? Denoting a default value that is used if none is supplied is fairly standard practice in this sort of documentation.

@zhiltsov-max
Copy link
Contributor

Yeah, looks like a good idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants