fix mistake in assigning header nodes for type

This commit is contained in:
Greg Myers
2020-03-22 23:45:47 +00:00
parent eb58fe687a
commit e9aebe6221
3 changed files with 20 additions and 38 deletions

View File

@@ -128,7 +128,7 @@ module Rswag
def upgrade_request_type!(metadata)
operation_nodes = metadata[:operation][:parameters] || []
path_nodes = metadata[:path_item][:parameters] || []
header_node = metadata[:response][:headers] ||= {}
header_node = metadata[:response][:headers] || {}
(operation_nodes + path_nodes + [header_node]).each do |node|
if node && node[:type] && node[:schema].nil?