-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Include total count in pagination header #1666
Comments
I believe we're sending |
Yes, that is indeed the case: https://github.com/ory/hydra/blob/master/client/handler.go#L200-L206 Should probably document this somewhere :D |
@aeneasr I have seen the code also, but in fact, there is no Say I have 100 clients, and calling
I have no idea where I have to expose more Headers, now my config is just |
What I meant is that you can calculate the approximate number of items by taking last (in that case it would be about 500 items or "50 pages a 10 items"):
Does that help? |
If Hydra can ensure that every list request can return the last rel, I think it helps |
I am confused, I thought you always receive the last rel in the header, that's what you said here ( #1666 (comment) ), no? Is the header missing sometimes? And if so, when exactly? |
Like this, #1667, when the Before fixing the bug, I can only assume that, if lacking of |
Yes, no matter what the behavior is, I hope the feature could be freezed and documented as fast as we can |
As always, we happily accept any PRs that help with that - for implementing this within Ory it always depends on internal sprint and milestone planning. |
@nmlc sorry I missed your comment - your contribution would be very much welcomed! |
Is your feature request related to a problem? Please describe.
When querying the Clients/Consent Sessions using pagination, ORY Hydra will only return results with some links, but not the total count of the items, which is useful to display in the frontend, you know, showing the total pages or something.
Describe the solution you'd like
Add the
total_count
parameter into Header.Although I think that the most elegant pagination solution is following JSON:API Spec, but I know it's almost impossible to change the data structure totally. So I think adding a parameter into Header is also a nice solution.
The text was updated successfully, but these errors were encountered: