Skip to content

Commit

Permalink
Fix spec
Browse files Browse the repository at this point in the history
  • Loading branch information
numbata committed Feb 19, 2025
1 parent bf4b71a commit 011800a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/grape-swagger/request_param_parsers/route.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,13 @@ def fetch_inherited_params(stackable_values)
end

def fulfill_params(path_params)
route.params.keys
# Merge path params options into route params
route.params.each_with_object({}) do |(param, definition), accum|
# The route.params hash includes both parametrized params (with a string as a key)
# and well-defined params from body/query (with a symbol as a key).
# We avoid overriding well-defined params with parametrized ones.
next if param.is_a?(String) && accum.key?(param.to_sym)

value = (path_params[param] || {}).merge(
definition.is_a?(Hash) ? definition : {}
)
Expand Down

0 comments on commit 011800a

Please sign in to comment.