Fix response examples

This commit is contained in:
Donatas Povilaitis
2021-01-29 20:47:46 +02:00
parent 670c94cc44
commit cbaf6cd3e4
2 changed files with 44 additions and 3 deletions

View File

@@ -132,9 +132,8 @@ module Rswag
def upgrade_content!(mime_list, target_node)
schema = target_node[:schema]
return if mime_list.empty? || schema.nil?
target_node[:content] ||= {}
target_node.merge!(content: {})
target_node[:content] ||= {}
mime_list.each do |mime_type|
# TODO upgrade to have content-type specific schema
(target_node[:content][mime_type] ||= {}).merge!(schema: schema)