mirror of
https://github.com/ditkrg/rswag.git
synced 2026-01-25 15:22:56 +00:00
Fix Authorization header missing and duplicating
This commit is contained in:
@@ -29,12 +29,15 @@ module Rswag
|
||||
path_item_params = metadata[:path_item][:parameters] || []
|
||||
security_params = derive_security_params(metadata, swagger_doc)
|
||||
|
||||
operation_params
|
||||
operation_params = operation_params
|
||||
.concat(path_item_params)
|
||||
.concat(security_params)
|
||||
.map { |p| p['$ref'] ? resolve_parameter(p['$ref'], swagger_doc) : p }
|
||||
.uniq { |p| p[:name] }
|
||||
.reject { |p| p[:required] == false && !example.respond_to?(p[:name]) }
|
||||
|
||||
metadata[:operation][:parameters] = operation_params unless operation_params.empty?
|
||||
operation_params
|
||||
end
|
||||
|
||||
def derive_security_params(metadata, swagger_doc)
|
||||
|
||||
Reference in New Issue
Block a user