rswag-specs 1.5.1 → 1.5.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 23a91d85729add4a8d92afb46fc30d11118a5b4b
4
- data.tar.gz: a0d981fd471134e0196481cb44b9785cd555cdb6
3
+ metadata.gz: 245c439ceac69ca5425c07f53157d0a411406ef1
4
+ data.tar.gz: e6e6e30d5f3b1c2e3df4e5be0a15ff8e70dbc188
5
5
  SHA512:
6
- metadata.gz: a397065a774ceca26bb9b7aa4e2a4e0e3db7de7814ebc69344aa4b8861051228fdebb6405e000542da1f6cce379ca0ab36163ce44fb5a55d6afd39b691e1c769
7
- data.tar.gz: 252085e99e03892c7e97f6bd741edeb4bea2db8066693bd20a4c58711f693bb2c5a7a2b46a367bedffd3e306c3ce0af12fc0b1089c42324d79e1d4a4caaf54bb
6
+ metadata.gz: debedee79e61ec31e9b9109b44e5653f033b172e977b5c9948ac3fdac44fbb4f74855fabbad1d23cfedccdb8bf70bb1a2393908644d49712513ff186c865e661
7
+ data.tar.gz: 83ba932ac13fe7f98f51c01fbd4b4fbfbbaa31bc4550724059fae76f0af52847a9502a29530ff5855a18f482cfc67d40862305868276f5e5b687f7655247324c
@@ -38,13 +38,13 @@ module Rswag
38
38
  end
39
39
 
40
40
  def derive_security_params(metadata, swagger_doc)
41
- requirements = metadata[:operation][:security] || swagger_doc[:security]
42
- scheme_names = requirements ? requirements.map { |r| r.keys.first } : []
43
- applicable_schemes = (swagger_doc[:securityDefinitions] || {}).slice(*scheme_names).values
41
+ requirements = metadata[:operation][:security] || swagger_doc[:security] || []
42
+ scheme_names = requirements.flat_map { |r| r.keys }
43
+ schemes = (swagger_doc[:securityDefinitions] || {}).slice(*scheme_names).values
44
44
 
45
- applicable_schemes.map do |scheme|
45
+ schemes.map do |scheme|
46
46
  param = (scheme[:type] == :apiKey) ? scheme.slice(:name, :in) : { name: 'Authorization', in: :header }
47
- param.merge(type: :string)
47
+ param.merge(type: :string, required: requirements.one?)
48
48
  end
49
49
  end
50
50
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rswag-specs
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.1
4
+ version: 1.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richie Morris
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-01 00:00:00.000000000 Z
11
+ date: 2017-09-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -107,7 +107,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
107
107
  version: '0'
108
108
  requirements: []
109
109
  rubyforge_project:
110
- rubygems_version: 2.6.12
110
+ rubygems_version: 2.6.11
111
111
  signing_key:
112
112
  specification_version: 4
113
113
  summary: A Swagger-based DSL for rspec-rails & accompanying rake task for generating