We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 55a94d0 commit a99e07aCopy full SHA for a99e07a
lib/grape-swagger/request_param_parsers/route.rb
@@ -49,9 +49,13 @@ def fetch_inherited_params(stackable_values)
49
end
50
51
def fulfill_params(path_params)
52
- route.params.keys
53
# Merge path params options into route params
54
route.params.each_with_object({}) do |(param, definition), accum|
+ # The route.params hash includes both parametrized params (with a string as a key)
55
+ # and well-defined params from body/query (with a symbol as a key).
56
+ # We avoid overriding well-defined params with parametrized ones.
57
+ next if param.is_a?(String) && accum.key?(param.to_sym)
58
+
59
value = (path_params[param] || {}).merge(
60
definition.is_a?(Hash) ? definition : {}
61
)
0 commit comments