Closed numbata closed 2 months ago
Looks good. Document it in README please? Maybe add a test with 3 levels just to be sure ;)
@dblock Sorry to keep you waiting. README updated: https://github.com/ruby-grape/grape/pull/2434/commits/6bc75fc7ba7e61104da386b7332da607da1bae61.
Motivation
Previously, the
with
' method in the Parameter DSL did not support nested structures. This forced to redefine the entire attribute set for each nested scope, which was cumbersome and prone to errors, especially in complex parameter structures.Solution
This PR introduces enhanced functionality to the
with
method that allows nested scopes to inherit and extend the attributes defined in parent scopes. By merging attributes from the current group with the new attributes, it simplifies parameter declarations and ensures a clean, DRY approach to specifying shared attributes in nested parameter contexts.