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:
vinhbachsy
2016-10-19 03:04:03 +08:00
parent 5ea97a4278
commit 0b0acfe4c7
4 changed files with 28 additions and 5 deletions

View File

@@ -264,7 +264,7 @@ end
### Response examples ###
You can provide custom response examples to the generated swagger file by calling the method `response_examples` inside the response block:
You can provide custom response examples to the generated swagger file by calling the method `examples` inside the response block:
```ruby
# spec/integration/blogs_spec.rb
@@ -275,7 +275,7 @@ describe 'Blogs API' do
get 'Retrieves a blog' do
response 200, 'blog found' do
response_examples 'application/json' => {
examples 'application/json' => {
id: 1,
title: 'Hello world!',
content: '...'