example group helper adjustment

This commit is contained in:
Oleg Yakovenko
2020-06-04 17:17:30 +03:00
parent 9c297317b2
commit 1ff396fb56
2 changed files with 15 additions and 3 deletions

View File

@@ -72,9 +72,16 @@ module Rswag
def examples(example = nil)
return super() if example.nil?
metadata[:response][:examples] = example
metadata[:response][:content] =
example.each_with_object({}) do |(mime, example_object), memo|
memo[mime] = { example: example_object }
end
end
# example.metadata[:response][:content] = {
# 'application/json' => { example: json }
# }
def run_test!(&block)
# NOTE: rspec 2.x support
if RSPEC_VERSION < 3