mirror of
https://github.com/ditkrg/rswag.git
synced 2026-01-25 15:22:56 +00:00
Support setting examples for response
Add helper method `response_examples` to inject response examples to swagger
This commit is contained in:
@@ -25,7 +25,7 @@ module Rswag
|
||||
# functionality while also setting the appropriate metadata if applicable
|
||||
def description(value=nil)
|
||||
return super() if value.nil?
|
||||
metadata[:operation][:description] = value
|
||||
metadata[:operation][:description] = value
|
||||
end
|
||||
|
||||
# These are array properties - note the splat operator
|
||||
@@ -61,6 +61,10 @@ module Rswag
|
||||
metadata[:response][:headers][name] = attributes
|
||||
end
|
||||
|
||||
def response_examples(example)
|
||||
metadata[:response][:examples] = example
|
||||
end
|
||||
|
||||
def run_test!
|
||||
# NOTE: rspec 2.x support
|
||||
if RSPEC_VERSION < 3
|
||||
|
||||
Reference in New Issue
Block a user