-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Endpoint Param of Type Integer Cannot Set Values Array #580
Comments
This may be a bug, but I didn't dig. Start by writing a test within grape? |
The problem is in this check of the class of the supplied values. https://github.com/intridea/grape/blob/master/lib/grape/validations.rb#L242-L245 The values are actually |
@ksoderstrom I don't think any side effect will appear, coerce validator does it same way https://github.com/intridea/grape/blob/master/lib/grape/validations/coerce.rb#L36 |
better solution is to use coerce validator logic and DRY if it's possible |
Closed via 4934baa. |
Given an
Integer
type parameter like the below:Grape will fail on start with the following:
This is unexpected, since
String
andSymbol
appear to work fine, and 10 and 11 are integers. I took a quick look at the validations code where the exceptions are raised but didn't understand the code too well. Is the Integer type not supported for thevalues
check?The text was updated successfully, but these errors were encountered: