mirror of
https://github.com/ditkrg/rswag.git
synced 2026-01-23 06:16:42 +00:00
Fix invalid Swagger in YAML
This commit is contained in:
parent
acab437a7d
commit
2c0f3c9396
@ -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 }
|
||||
|
||||
Loading…
Reference in New Issue
Block a user