grape
grape copied to clipboard
Parameter renaming doesn't work for hash inside given block.
Hello. Parameter renaming doesn't work if there is a hash inside given.
Params:
requires :a, type: Hash do
optional :c, type: String
given :c do
requires :b, type: Hash do
requires :input_field, as: :output_field
end
end
end
Input:
{ a: { b: { input_field: 'value' }, c: 'value2' } }
After running declared(params, evaluate_given: true):
Expected:
{ a: { b: { output_field: 'value' }, c: 'value2' } }
Actual: Parameter input_field is not renamed to output_field.
{ a: { b: { input_field: 'value' }, c: 'value2' } }
Info: grape version 1.7.1, ruby 3.0.2
Try turning this into a spec, let's see that it's still the case in the next 1.8?