rswag-specs 1.5.2 → 1.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/rswag/specs/request_factory.rb +3 -4
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 3ee266d1a753e446ca8ab4e7ed2afe7788f43c7fac95a11511ea60e8356ec9ed
|
4
|
+
data.tar.gz: 0581a4a5436807020e5267e7c0e32b1015efd10a83e9b7095643613dfda8fc51
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 35dc5bc334d93abfa784621c8b0203ee24e331978a563541ca197206e1824d942be021738c998e015f22f5052ba52c9fedb20bd5bb303744f209ec3bc15ac561
|
7
|
+
data.tar.gz: 1b858f35aea5971c1c4603c333463c8bb4dcf1790b93987c45a5d50cd0be6e911d0983c4db0bb7a734cbda2b3983d0f134e3ecc8dd64f88f57d00c8f609d38a0
|
@@ -29,9 +29,8 @@ module Rswag
|
|
29
29
|
path_item_params = metadata[:path_item][:parameters] || []
|
30
30
|
security_params = derive_security_params(metadata, swagger_doc)
|
31
31
|
|
32
|
-
|
33
|
-
|
34
|
-
.concat(security_params)
|
32
|
+
# NOTE: Use of + instead of concat to avoid mutation of the metadata object
|
33
|
+
(operation_params + path_item_params + security_params)
|
35
34
|
.map { |p| p['$ref'] ? resolve_parameter(p['$ref'], swagger_doc) : p }
|
36
35
|
.uniq { |p| p[:name] }
|
37
36
|
.reject { |p| p[:required] == false && !example.respond_to?(p[:name]) }
|
@@ -49,8 +48,8 @@ module Rswag
|
|
49
48
|
end
|
50
49
|
|
51
50
|
def resolve_parameter(ref, swagger_doc)
|
51
|
+
key = ref.sub('#/parameters/', '').to_sym
|
52
52
|
definitions = swagger_doc[:parameters]
|
53
|
-
key = ref.sub('#/parameters/', '')
|
54
53
|
raise "Referenced parameter '#{ref}' must be defined" unless definitions && definitions[key]
|
55
54
|
definitions[key]
|
56
55
|
end
|
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.
|
4
|
+
version: 1.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Richie Morris
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-04-24 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
|
110
|
+
rubygems_version: 2.7.6
|
111
111
|
signing_key:
|
112
112
|
specification_version: 4
|
113
113
|
summary: A Swagger-based DSL for rspec-rails & accompanying rake task for generating
|