-
-
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
Validator fails if number is passed instead of object #1860
Labels
Comments
Looks like a legit bug, please PR a fix. |
I will try. Might take me some time to get around it, though. |
Closed via #1947 (comment) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This happens for something like this:
and then POSTing something like this:
Setting
requires :bar
(instead of optional) fixes this.While it is arguable that allowing empty objects does not make too much sense, who knows what users might want?
The problem is here:
grape/lib/grape/validations/validators/base.rb
Line 41 in 2dcef9a
It probably makes sense to check if resource_params is actually a hash in this case.
The text was updated successfully, but these errors were encountered: