docs: ETU-74448: Updated guidelines on pagination. - #118
Conversation
hw-knowit
left a comment
There was a problem hiding this comment.
A good start!
I think the guide needs a lot of massaging both in content and structure to read clearly as an introduction to keyset pagination for readers who may not have heard of it before, and we will need some discussion on the exact format expected of all applications.
Many of my comments aren't necessarily to be taken as "this must be changed exactly so", but to open up a discussion with a concrete suggestion to start off.
I'm excited to see this implemented.
|
My suggested interface in summary. Names debatable of course. While writing these out side by side, it seemed natural to provide a paging object for both interfaces so they appear more similar. If we are to put 4 (maybe) required fields in root the response gets pretty messy, and doing it like this makes it easy to provide a If we allow the application to decide whether to provide For Offset Pagination: Keyset Pagination: |
|
And an additional consideration: Spring has HATEOAS which returns the following structure. With the number of Spring apps in Entur it may be wise to allow (or enforce..?) pagination responses to look like this. Note the |
|
In GraphQL, cursor pagination is the norm and there the spec looks somewhat like this which enables the following questions to be answered for the client:
Additionally it would be useful to implement In the context of REST APIs, I would probably do it similar to what is described above by @hw-knowit but I might make some of the fields optional. It might cost a lot to calculate |
… point to the Next item to get, that is up to the backend implementation.
…y a relevant point.
No description provided.