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

Clarify page number for pagination #187

Merged
merged 5 commits into from
Nov 6, 2019
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions optimade.rst
Original file line number Diff line number Diff line change
Expand Up @@ -608,14 +608,14 @@ Standard OPTIONAL URL query parameters standardized by the JSON API specificatio

Example: http://example.com/optimade/v0.9/structures?page_limit=100

- **page\_{offset, page, cursor, above, below}**: A server MUST implement pagination in the case of no user-specified :query-param:`sort` parameter (via the :field:`links` response field, see section `JSON Response Schema: Common Fields`_).
- **page\_{offset, number, cursor, above, below}**: A server MUST implement pagination in the case of no user-specified :query-param:`sort` parameter (via the :field:`links` response field, see section `JSON Response Schema: Common Fields`_).
A server MAY implement pagination in concert with :query-param:`sort`.
The following parameters, all prefixed by "page\_", are RECOMMENDED for use with pagination.
If an implementation chooses

- *offset-based pagination*: using :field:`page_offset` and :field:`page_limit` is RECOMMENDED.
- *cursor-based pagination*: using :field:`page_cursor` and :field:`page_limit` is RECOMMENDED.
- *page-based pagination*: using :field:`page_number` and :field:`page_limit` is RECOMMENDED (:field:`page_limit` is equivalent to page "size").
- *page-based pagination*: using :field:`page_number` and :field:`page_limit` is RECOMMENDED (:field:`page_limit` is the number of entries per page). It is RECOMMENDED that the first page has number 1, i.e., that :field:`page_number` is 1-based.
merkys marked this conversation as resolved.
Show resolved Hide resolved
- *value-based pagination*: using :field:`page_above`/:field:`page_below` and :field:`page_limit` is RECOMMENDED.

Examples (all OPTIONAL behavior a server MAY implement):
Expand Down