Skip to content
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

Accept zero per page #125

Open
s-andringa opened this issue Mar 10, 2020 · 0 comments
Open

Accept zero per page #125

s-andringa opened this issue Mar 10, 2020 · 0 comments

Comments

@s-andringa
Copy link

s-andringa commented Mar 10, 2020

HI David. I noticed that the per_page param is converted to the default value when it is 0. I'd like my API's clients to be able to fetch merely the total number of objects (found in the X-Total header) w/o fetching any actual objects. This is easily implemented by accepting 0 as a valid per_page value. Right now I'd have to monkey patch methods (i.e this one) to make that work. Would you consider allowing zero for the per_page param? Maybe using a new config option if you don't want to break existing behavior.

I'm not sure how well supported this is by the underlying pagination libraries though, you might run into ZeroDivisionError's and such, which you'll then have to deal with.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant