mirror of
https://github.com/ditkrg/rswag.git
synced 2026-01-25 15:22:56 +00:00
Rename response_examples to examples for consistent DSL
Special handling `examples` invocation with no parameters to avoid overriding the `examples` method of rspec-core ExampleGroup
This commit is contained in:
@@ -61,7 +61,11 @@ module Rswag
|
||||
metadata[:response][:headers][name] = attributes
|
||||
end
|
||||
|
||||
def response_examples(example)
|
||||
# NOTE: Similar to 'description', 'examples' need to handle the case when
|
||||
# being invoked with no params to avoid overriding 'examples' method of
|
||||
# rspec-core ExampleGroup
|
||||
def examples(example = nil)
|
||||
return super() if example.nil?
|
||||
metadata[:response][:examples] = example
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user