Fix invalid Swagger in YAML

This commit is contained in:
Greg Myers 2019-11-02 12:58:36 +00:00
parent acab437a7d
commit 2c0f3c9396

View File

@ -48,14 +48,17 @@ module Rswag
def pretty_generate(doc)
if @config.swagger_format == :yaml
# NOTE: Yaml will quite happily embed ruby-only classes such as symbols.
# clean_doc = stringify(doc)
YAML.dump(doc)
YAML.dump(doc.deep_stringify_keys)
else # config errors are thrown in 'def swagger_format', no throw needed here
JSON.pretty_generate(doc)
end
end
def deep_stringify_hash_keys(doc)
doc
end
def metadata_to_swagger(metadata)
response_code = metadata[:response][:code]
response = metadata[:response].reject { |k,v| k == :code }