forked from ruby-grape/grape
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Bugfix] Handle deeply-nested dependent params (ruby-grape#1661)
* Repro issue ruby-grape#1659 * [Fix] Handle deeply-nested dependencies with `given`. Behind the scenes, each call to `requires` or other params DSL method pushes an entry onto a flat list of validators. The nesting structure that your parameters can take on is tracked as an up-tree separately on each scope, but that relationship isn't used to traverse the validations. So, when I moved the dependency checking out of `should_validate?` and into the actual validation, the `given` dependency stopped taking effect after you nested parameters more than one level deep underneath. To restore the behavior, I made the validation check recursively upwards to see if it should or should not validate that scope. * Add changelog entry.
- Loading branch information
Showing
4 changed files
with
47 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters