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

Coerce params to integer before validations. #41

Closed
nasa42 opened this issue Oct 1, 2017 · 0 comments
Closed

Coerce params to integer before validations. #41

nasa42 opened this issue Oct 1, 2017 · 0 comments

Comments

@nasa42
Copy link

nasa42 commented Oct 1, 2017

If per_page parameter is not a valid integer, MaxValueValidator would raise an ArgumentError - comparison of String with 100 failed (if max_per_page is 100). Because this validation happens before Grape's param validation/coercion, it needs to be manually coerced here.

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

2 participants