Feature #1598
closedAPI: Offset Pagination
Description
For example:
- ?limit=20 will return first page
- ?limit=20&offset=20 will return second page
- ?limit=20&offset=40 will return third page
- and so on
Updated by Bernhard Koschiček-Krombholz about 3 years ago
- Tracker changed from Question to Feature
- Status changed from New to Acknowledged
- Assignee set to Bernhard Koschiček-Krombholz
- Target version set to 208
We/I choose the Keyset/Cursor Pagination, because it is know as best practice at the moment and quite robust. (Good overview about that: https://nordicapis.com/everything-you-need-to-know-about-api-pagination/ and https://ignaciochiazzo.medium.com/paginating-requests-in-apis-d4883d4c1c4c)
I can implement offset pagination. But I also can give you the option to directly jump to a page, like ?page=5&limit=100. I think this looks better, especially for the users (as I concluded, from what you said, it is also for the user, that they can copy a link with the page information). If the page does not exist, it will show the last page of the request.
Would the page solution suits you?
Updated by Bernhard Koschiček-Krombholz about 3 years ago
- Subject changed from Offset Pagination to API: Offset Pagination
Updated by Andreas Olschnögger about 3 years ago
Bernhard Koschiček-Krombholz wrote:
We/I choose the Keyset/Cursor Pagination, because it is know as best practice at the moment and quite robust. (Good overview about that: https://nordicapis.com/everything-you-need-to-know-about-api-pagination/ and https://ignaciochiazzo.medium.com/paginating-requests-in-apis-d4883d4c1c4c)
I can implement offset pagination. But I also can give you the option to directly jump to a page, like ?page=5&limit=100. I think this looks better, especially for the users (as I concluded, from what you said, it is also for the user, that they can copy a link with the page information). If the page does not exist, it will show the last page of the request.
Would the page solution suits you?
Yes, this sounds good to me.
Updated by Bernhard Koschiček-Krombholz about 3 years ago
- Status changed from Acknowledged to Closed
- Target version changed from 208 to 7.0.0
Sorry for the delay. It is done for 0.2 and 0.3.
Usage ?page=5, then you come to the page 5 of the given query. If you use last and first with page, page will overwrite first and last. It is usable together with limit. Remember, limit is by default 20.