Skip to content

Commit

Permalink
Merge pull request #39 from blocknotes/fix-parameters-merging
Browse files Browse the repository at this point in the history
Fix parameters merging
  • Loading branch information
k0kubun authored Mar 18, 2022
2 parents a69a7ec + c653282 commit 2011297
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
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
6 changes: 0 additions & 6 deletions spec/rails/doc/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -176,12 +176,6 @@ paths:
schema:
type: integer
example: 1
- name: id
in: path
required: true
schema:
type: integer
example: 2
responses:
'200':
description: returns a table
Expand Down

0 comments on commit 2011297

Please sign in to comment.