-
Notifications
You must be signed in to change notification settings - Fork 15
LimitOffset pagination crashes Browseable API when limit=0 #75
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
Hey @wiresurfer, redirecting you to Jonathan. |
Hi @wiresurfer The issue that you are facing is not related to the issue #4079 of the DRF that you mentioned. Now, going back to the issue, we can comment the following:
And there you have the problem if you do not have the incoming request object already available for the paginator. While you wait for the fix to be public and you can upgrade your dependency, you can make workaround, writing a custom class and redefine the
|
@jonatrios thank you for the update. Thank you for the detailed writeup. I appreciate you taking the time to put the references down. |
We are using LimitOffsetPagination on all our endpoints, and noticed that sending limit=0 to the browsable api causes a crash. Getting json output (either from an xmlhttprequest or from format=json) does not crash.
Steps to reproduce
Expected behavior
Should show the browsable api for the endpoint, with the following data:
{
"count":148,
"next":"https://api.co/page/?limit=0&offset=20",
"previous":"https://api.co/page/?limit=0&offset=20",
"results":[]
}
Linked DRF issue
This issue was reported and resolved in DRF a year ago.
encode/django-rest-framework#4079
This was resolved in >3.6.0 of DRF.
Notes
We use a RqlLimitOffset pagination in our project.
Double checking the verision of DRF, we are at
3.14.0
Django-Rql is at
4.4.0
The text was updated successfully, but these errors were encountered: