Skip to content

Commit

Permalink
Fix parameters hash merging
Browse files Browse the repository at this point in the history
  • Loading branch information
Mattia Roccoberton committed Mar 18, 2022
1 parent a69a7ec commit 686a001
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/rspec/openapi/schema_merger.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ def deep_reverse_merge!(base, spec)
elsif base[key].is_a?(Array) && value.is_a?(Array)
if key == "parameters"
# merge arrays
base[key] |= value
keys = base[key].map { |val| val.slice('name', 'in') }
value.each { |val| base[key].push(val) if keys.exclude?(val.slice('name', 'in')) }
end
else
# no-op
Expand Down

0 comments on commit 686a001

Please sign in to comment.