-
-
Notifications
You must be signed in to change notification settings - Fork 158
Unexpected behavior on negative page number #757
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
Comments
related: #643 |
From #643 :
Agreed: this does not make sense. Should be
|
On second thought, I believe that reversing the sort order of an unordered set is not a very useful feature to have. Users can always sort descending by ID if desired. Making negative page numbers mean 'from end' has some drawbacks:
For now, I intend to remove support for negative page numbers entirely. When the need for page-from-end comes up, we can revisit how to best implement that. |
It doesn't seem right that a negative page number reverses the sort order.
I believe a better syntax for reversing the sort order would be: ?sort=- (without any attribute). This can be combined with attributes: ?sort=lastname,-age,-
With that in place, we should change the meaning of a negative page number, to indicate (n) pages back from the last one. This requires to know the number of total pages, so it should fail with an error in case options.IncludeTotalRecordCount is set to false.
The text was updated successfully, but these errors were encountered: