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

Fixed validation of invalid params with mutual_exclusive inside hash #1017

Merged
merged 1 commit into from
Jun 4, 2015

Conversation

lasseebert
Copy link
Contributor

This fixes an issue with mutual_exclusive params inside a type: Hash param.

With these params:

params do
  optional :wine, type: Hash do
    optional :grape
    optional :country
    mutually_exclusive :grape, :country
  end
end

And the request params { wine: "This is a string, not a hash" }

I'd expect an error message, but instead get an unhandled error:

undefined method `stringify_keys' for "This is a string, not a hash":String

@dblock
Copy link
Member

dblock commented Jun 3, 2015

Can you please squash/rebase these? Thanks.

@lasseebert lasseebert force-pushed the mutual_exclusive_inside_hash branch from f5df9e8 to 8ed02c3 Compare June 3, 2015 21:45
@lasseebert
Copy link
Contributor Author

Rebased to latest master

@lasseebert lasseebert force-pushed the mutual_exclusive_inside_hash branch from 8ed02c3 to 4088745 Compare June 3, 2015 21:48
@lasseebert
Copy link
Contributor Author

...and squashed :)

dblock added a commit that referenced this pull request Jun 4, 2015
Fixed validation of invalid params with mutual_exclusive inside hash
@dblock dblock merged commit 877e089 into ruby-grape:master Jun 4, 2015
@dblock
Copy link
Member

dblock commented Jun 4, 2015

Merged, thanks.

@lasseebert
Copy link
Contributor Author

Thanks :)

@lasseebert lasseebert deleted the mutual_exclusive_inside_hash branch June 4, 2015 12:41
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