Skip to content

Accept zero per page  #125

@s-andringa

Description

@s-andringa

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions