-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Support Link headers (rfc8288) for next/previous/first/last page #3787
Comments
Curious, what type of clients have builtin support for |
I'm now persuaded that there is no real standard for content format, neither for pagination, neither for filters. There are officially some srabdatds but no one is W3C standard and even when applied the field names are generally something custom |
But I'm wondering that as soon as postgrest+openapi or supabase/postgrest+openapi will have its own connectors in powerbi, qlik sens and other dataviz products every little projects will conform to postgrest standard as it is simple to implement even on non postgresql db. ODATA, json:api and hal+json are aui complexe to implement and so only big projects implement them |
I implement the postgREST pagination standard (Range/Content-Range) on a personnal Python/FastAPI project and rebasing on the HTTP standard. I have implemented the multi-range request
One solution could be to take the first range, with the first range size or with the server standard range size |
Problem
A convenient way of managing pagination in addition to Range/Content-Range is to add links to next/previous/first/last page just like https://jsonapi.org/ standard
it allows to "dummy" client to parse easely all pages just by testing the presence (or null) of link to "next" page for example. if missing or null means that we've reach the last page. in the same way, previous is null or absent when reaching the first page
Solution
I was looking for a way to implement this complementary solution and I've found the RFC8288 Web Linking defining Link http header that permit to add links in a rfc conform way
Proposition could be
Response header:
for items/limit/offset two solutions are presently available : limit/offset as query parameters and Range header parameter
RFC8288 allows query parameters as it allows full http link
Link: http;//domain/api/v1/resource?offset=10&limit=10, rel="next"
It is not explicitly defined that parameters can be used as header parameters but it could be:
Link: http;//domain/api/v1/resource, Range=10-19, rel="next"
The text was updated successfully, but these errors were encountered: