Skip to content

Commit 3aad58e

Browse files
committed
Add security option in desc block
1 parent 43ef591 commit 3aad58e

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

lib/grape/dsl/desc.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ module Desc
2424
# @option options :nickname [String] nickname of the endpoint
2525
# @option options :produces [Array[String]] a list of MIME types the endpoint produce
2626
# @option options :consumes [Array[String]] a list of MIME types the endpoint consume
27+
# @option options :security [Array[Hash]] a list of security schemes
2728
# @option options :tags [Array[String]] a list of tags
2829
# @yield a block yielding an instance context with methods mapping to
2930
# each of the above, except that :entity is also aliased as #success
@@ -100,6 +101,7 @@ def desc_container
100101
:nickname,
101102
:produces,
102103
:consumes,
104+
:security,
103105
:tags
104106
)
105107

spec/grape/dsl/desc_spec.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ class Dummy
4444
nickname: 'nickname',
4545
produces: %w[array of mime_types],
4646
consumes: %w[array of mime_types],
47-
tags: %w[tag1 tag2]
47+
tags: %w[tag1 tag2],
48+
security: %w[array of security schemes]
4849
}
4950

5051
subject.desc 'The description' do
@@ -71,6 +72,7 @@ class Dummy
7172
produces %w[array of mime_types]
7273
consumes %w[array of mime_types]
7374
tags %w[tag1 tag2]
75+
security %w[array of security schemes]
7476
end
7577

7678
expect(subject.namespace_setting(:description)).to eq(expected_options)

0 commit comments

Comments
 (0)