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

Skip to set default value unless meets_dependency? #2097

Merged
merged 2 commits into from
Aug 20, 2020

Conversation

wanabe
Copy link
Contributor

@wanabe wanabe commented Aug 20, 2020

Hello,

Grape::Validations::Base#validate! calls #validate_param! only if @scope.meets_dependency?(val, params) is truthy.
But Grape::Validations::DefaultValidator#validate! ignores the cope dependency now.

It doesn't matter in most cases because of @scope.should_validate?, but this is not the case for an array that contains both matching and non-matching conditions.
So I guess Grape::Validations::DefaultValidator#validate! should the check scope dependency as same as Grape::Validations::Base#validate!.

How about it?

@dblock dblock merged commit fe6a4a4 into ruby-grape:master Aug 20, 2020
@dblock
Copy link
Member

dblock commented Aug 20, 2020

Thanks for this.

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