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

[V2] Add validation for numerical pagination argument values to be non-negative #8833

Closed
wants to merge 17 commits into from

Conversation

aemous
Copy link
Contributor

@aemous aemous commented Jul 31, 2024

Description of changes:
I've added validation on numerical pagination arguments to ensure they are non-negative. This fixes a bug where using negative numbers for pagination arguments can cause erroneous results.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

class PageArgument(BaseCLIArgument):
type_map = {
'string': str,
'integer': int,
'long': int,
'integer': nonnegative_int,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possible future concern: see my comment on V1 PR about this.

@aemous
Copy link
Contributor Author

aemous commented Aug 8, 2024

Going with another approach to this

@aemous aemous closed this Aug 8, 2024
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

Successfully merging this pull request may close these issues.

2 participants