Skip to content

Commit

Permalink
Update CHANGELOG and README
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Schuster committed May 21, 2016
1 parent 79e8c50 commit cd8b424
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 8 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#### Features

* Your contribution here.
* [#434](https://github.com/ruby-grape/grape-swagger/pull/434): Add summary to the operation object generator to be more compliant with [OpenAPI v2](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#operation-object) - [@aschuster3](https://github.com/aschuster3).

#### Fixes

Expand Down
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,32 @@ end
```
#### Overriding the route summary
By default, the route summary is filled with the value supplied to `desc`.
```ruby
namespace 'order' do
desc 'This will be your summary'
get :order_id do
...
end
end
```
To override the summary, add `summary: '[string]'` after the description.
```ruby
namespace 'order' do
desc 'This will be your summary',
summary: 'Now this is your summary!'
get :order_id do
...
end
end
```
#### Expose nested namespace as standalone route
Use the `nested: false` property in the `swagger` option to make nested namespaces appear as standalone resources.
Expand Down
1 change: 0 additions & 1 deletion lib/grape-swagger/endpoint.rb
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ def path_item(routes, options)
end

def method_object(route, options, path)
puts "lib/grape-swagger/endpoint.rb:105 DEBUG OUTPUT FOR GRAPE-SWAGGER: #{route.options}"
method = {}
method[:summary] = summary_object(route)
method[:description] = description_object(route, options[:markdown])
Expand Down
3 changes: 0 additions & 3 deletions spec/support/model_parsers/entity_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,6 @@ class RecursiveModel < Grape::Entity
'QueryInput' => {
'type' => 'object',
'properties' => { 'elements' => { 'type' => 'array', 'items' => { '$ref' => '#/definitions/QueryInputElement' }, 'description' => 'Set of configuration' } },
'summary' => 'nested route inside namespace',
'description' => 'nested route inside namespace'
},
'QueryInputElement' => {
Expand All @@ -302,7 +301,6 @@ class RecursiveModel < Grape::Entity
'ApiError' => {
'type' => 'object',
'properties' => { 'code' => { 'type' => 'integer', 'format' => 'int32', 'description' => 'status code' }, 'message' => { 'type' => 'string', 'description' => 'error message' } },
'summary' => 'This gets Things.',
'description' => 'This gets Things.'
},
'Something' => {
Expand All @@ -313,7 +311,6 @@ class RecursiveModel < Grape::Entity
'links' => { 'type' => 'link' },
'others' => { 'type' => 'text' }
},
'summary' => 'This gets Things.',
'description' => 'This gets Things.'
}
}
Expand Down
3 changes: 0 additions & 3 deletions spec/support/model_parsers/representable_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,6 @@ class RecursiveModel < Representable::Decorator
'QueryInput' => {
'type' => 'object',
'properties' => { 'elements' => { 'type' => 'array', 'items' => { '$ref' => '#/definitions/QueryInputElement' }, 'description' => 'Set of configuration' } },
'summary' => 'nested route inside namespace',
'description' => 'nested route inside namespace'
},
'QueryInputElement' => {
Expand All @@ -371,7 +370,6 @@ class RecursiveModel < Representable::Decorator
'ApiError' => {
'type' => 'object',
'properties' => { 'code' => { 'type' => 'integer', 'format' => 'int32', 'description' => 'status code' }, 'message' => { 'type' => 'string', 'description' => 'error message' } },
'summary' => 'This gets Things.',
'description' => 'This gets Things.'
},
'Something' => {
Expand All @@ -382,7 +380,6 @@ class RecursiveModel < Representable::Decorator
'links' => { 'type' => 'array', 'items' => { 'description' => '', 'type' => 'link' } },
'others' => { 'description' => '', 'type' => 'text' }
},
'summary' => 'This gets Things.',
'description' => 'This gets Things.'
}
}
Expand Down

0 comments on commit cd8b424

Please sign in to comment.