Skip to content

Commit a99e07a

Browse files
committed
Fix spec
1 parent 55a94d0 commit a99e07a

File tree

1 file changed

+5
-1
lines changed
  • lib/grape-swagger/request_param_parsers

1 file changed

+5
-1
lines changed

lib/grape-swagger/request_param_parsers/route.rb

+5-1
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,13 @@ def fetch_inherited_params(stackable_values)
4949
end
5050

5151
def fulfill_params(path_params)
52-
route.params.keys
5352
# Merge path params options into route params
5453
route.params.each_with_object({}) do |(param, definition), accum|
54+
# 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+
5559
value = (path_params[param] || {}).merge(
5660
definition.is_a?(Hash) ? definition : {}
5761
)

0 commit comments

Comments
 (0)