mirror of
https://github.com/ditkrg/rswag.git
synced 2026-01-22 22:06:43 +00:00
Merge pull request #392 from pfilipow/master
don't clobber response content
This commit is contained in:
commit
d645df207e
@ -118,7 +118,7 @@ module Rswag
|
||||
|
||||
def build_query_string_part(param, value)
|
||||
name = param[:name]
|
||||
return "#{name}=#{value}" unless param[:type].to_sym == :array
|
||||
return "#{name}=#{value}" unless param[:type]&.to_sym == :array
|
||||
|
||||
case param[:collectionFormat]
|
||||
when :ssv
|
||||
|
||||
@ -129,13 +129,14 @@ module Rswag
|
||||
end
|
||||
|
||||
def upgrade_content!(mime_list, target_node)
|
||||
target_node.merge!(content: {})
|
||||
target_node.merge!(content: {}) if target_node[:content].nil?
|
||||
schema = target_node[:schema]
|
||||
return if mime_list.empty? || schema.nil?
|
||||
|
||||
mime_list.each do |mime_type|
|
||||
# TODO upgrade to have content-type specific schema
|
||||
target_node[:content][mime_type] = { schema: schema }
|
||||
target_node[:content][mime_type] = {} if target_node[:content][mime_type].nil?
|
||||
target_node[:content][mime_type][:schema] = schema
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user