Skip to content

Commit

Permalink
Support body_name in desc block (#1832)
Browse files Browse the repository at this point in the history
  • Loading branch information
fotos authored and dblock committed Dec 5, 2018
1 parent 933750f commit 7413b7e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

#### Features

* [#1831](https://github.com/ruby-grape/grape/pull/1831): Support `security` in `desc` block - [@fotos](https://github.com/fotos).
* Your contribution here.
* [#1832](https://github.com/ruby-grape/grape/pull/1832): Support `body_name` in `desc` block - [@fotos](https://github.com/fotos).
* [#1831](https://github.com/ruby-grape/grape/pull/1831): Support `security` in `desc` block - [@fotos](https://github.com/fotos).

#### Fixes

Expand Down
2 changes: 2 additions & 0 deletions lib/grape/dsl/desc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ module Desc
# @option options :http_codes [Array[Array]] possible HTTP codes this
# endpoint may return, with their meanings, in a 2d array
# @option options :named [String] a specific name to help find this route
# @option options :body_name [String] override the autogenerated body name param
# @option options :headers [Hash] HTTP headers this method can accept
# @option options :hidden [Boolean] hide the endpoint or not
# @option options :deprecated [Boolean] deprecate the endpoint or not
Expand Down Expand Up @@ -94,6 +95,7 @@ def desc_container
:entity,
:http_codes,
:named,
:body_name,
:headers,
:hidden,
:deprecated,
Expand Down
2 changes: 2 additions & 0 deletions spec/grape/dsl/desc_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class Dummy
entity: Object,
http_codes: [[401, 'Unauthorized', 'Entities::Error']],
named: 'My named route',
body_name: 'My body name',
headers: [
XAuthToken: {
description: 'Valdates your identity',
Expand Down Expand Up @@ -55,6 +56,7 @@ class Dummy
success Object
failure [[401, 'Unauthorized', 'Entities::Error']]
named 'My named route'
body_name 'My body name'
headers [
XAuthToken: {
description: 'Valdates your identity',
Expand Down

0 comments on commit 7413b7e

Please sign in to comment.