swagalicious 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/swagalicious/request_factory.rb +9 -8
- data/lib/swagalicious/version.rb +1 -1
- data/swagalicious.gemspec +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7b591f97affd8dc1fa23c0ba79eb43aeccfc0b954d6a8eb8a3dbaae10d4e5da8
|
4
|
+
data.tar.gz: 6d5b20f69b8543406a99e5d1e59848d02b1299558f14be5f9023e473a7b1e903
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 233c014d7df4f7625275193eda7fe58ae8cfd7ad3dea95ce8a4e19aabad3d9b9ef4ad082042bc4ba873d698a64b0b262298f2859fc13f1408729462dc478a6dc
|
7
|
+
data.tar.gz: 93f9dcb0fb104aaac7a54cfbda195dcd27d8b47598f7176cc65f6b5b0f0ac6b260f2f760ee7b9355ad429c91c1ebf164bff5ae28c7aace7686559ea9b89b6095
|
data/Gemfile.lock
CHANGED
@@ -35,11 +35,11 @@ class Swagalicious
|
|
35
35
|
|
36
36
|
def derive_security_params(metadata, swagger_doc)
|
37
37
|
requirements = metadata[:operation][:security] || swagger_doc[:security] || []
|
38
|
-
scheme_names = requirements.flat_map(
|
38
|
+
scheme_names = requirements.flat_map { |r| r.has_key?(:type) ? r[:type] : r.keys }
|
39
39
|
schemes = security_version(scheme_names, swagger_doc)
|
40
40
|
|
41
41
|
schemes.map do |scheme|
|
42
|
-
param = (scheme[:type] == :apiKey) ? scheme.slice(:name, :in, :required) : { name: "Authorization", in: :header }
|
42
|
+
param = (scheme[:type] == :apiKey) ? scheme.slice(:name, :in, :required, :force_name) : { name: "Authorization", in: :header }
|
43
43
|
param.merge(required: requirements.one?) unless param.has_key?(:required)
|
44
44
|
param.merge(type: :string)
|
45
45
|
end
|
@@ -127,7 +127,7 @@ class Swagalicious
|
|
127
127
|
.map do |p|
|
128
128
|
variable_name = p[:variable_name] || p[:name]
|
129
129
|
|
130
|
-
[p[:name], example.send(variable_name).to_s]
|
130
|
+
[p[:name], example.send(variable_name).to_s, p[:force_name]]
|
131
131
|
end
|
132
132
|
|
133
133
|
# Accept header
|
@@ -145,15 +145,16 @@ class Swagalicious
|
|
145
145
|
end
|
146
146
|
|
147
147
|
# Rails test infrastructure requires rackified headers
|
148
|
-
rackified_tuples = tuples.map do |
|
148
|
+
rackified_tuples = tuples.map do |tuple|
|
149
149
|
[
|
150
|
-
case
|
150
|
+
case tuple[0]
|
151
151
|
when "Accept" then "HTTP_ACCEPT"
|
152
152
|
when "Content-Type" then "CONTENT_TYPE"
|
153
|
-
when "Authorization"
|
154
|
-
|
153
|
+
when "Authorization"
|
154
|
+
tuple[2] ? tuple[0] : "HTTP_AUTHORIZATION"
|
155
|
+
else tuple[0]
|
155
156
|
end,
|
156
|
-
|
157
|
+
tuple[1]
|
157
158
|
]
|
158
159
|
end
|
159
160
|
|
data/lib/swagalicious/version.rb
CHANGED
data/swagalicious.gemspec
CHANGED
@@ -29,7 +29,7 @@ Gem::Specification.new do |spec|
|
|
29
29
|
spec.add_dependency "json-schema"
|
30
30
|
spec.add_dependency "oj", "~> 3.11.0"
|
31
31
|
spec.add_dependency "ox", "~> 2.14.14"
|
32
|
-
spec.add_dependency "rack-test"
|
32
|
+
spec.add_dependency "rack-test"
|
33
33
|
spec.add_dependency "rspec", "~> 3"
|
34
34
|
|
35
35
|
spec.add_development_dependency "rubocop", "~> 1.48.0"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: swagalicious
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eugene Howe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-08-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -84,16 +84,16 @@ dependencies:
|
|
84
84
|
name: rack-test
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- - "
|
87
|
+
- - ">="
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version:
|
89
|
+
version: '0'
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- - "
|
94
|
+
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version:
|
96
|
+
version: '0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: rspec
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|