rspec-openapi 0.22.1 → 0.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/create_release.yml +1 -1
- data/lib/rspec/openapi/schema_builder.rb +16 -2
- data/lib/rspec/openapi/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9de2ab7b530ea8a400d157e5296b042e7a1988b84537a2def73007a169d530fe
|
|
4
|
+
data.tar.gz: 4550f2cee402ccbd45c2722a8bac19550494e2822ea5344a09294ba06845901b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9ad939c9bfc561a429838f5e6149c1cefbe7c6e1346c8d0cf95fd83fa7cbd55654c7dcb9d889d9fdb8f6eead6c35c6eb316d35445679ba6cabc3b8e7cc2a5022
|
|
7
|
+
data.tar.gz: bac87ded3a5f9cbcbedf675b8a29e18ea53ec87f3abc396d56872279a6c88c879afcb09589db87796736b947cef34ef9b59af49e903e297c6aa0c4389f5b2465
|
|
@@ -126,9 +126,9 @@ class << RSpec::OpenAPI::SchemaBuilder = Object.new
|
|
|
126
126
|
}.compact
|
|
127
127
|
end
|
|
128
128
|
|
|
129
|
-
query_params = record.query_params.map do |key, value|
|
|
129
|
+
query_params = flatten_query_params(record.query_params).map do |key, value|
|
|
130
130
|
{
|
|
131
|
-
name:
|
|
131
|
+
name: key,
|
|
132
132
|
in: 'query',
|
|
133
133
|
required: record.required_request_params.include?(key),
|
|
134
134
|
schema: build_property(try_cast(value), key: key, record: record),
|
|
@@ -175,6 +175,20 @@ class << RSpec::OpenAPI::SchemaBuilder = Object.new
|
|
|
175
175
|
end
|
|
176
176
|
end
|
|
177
177
|
|
|
178
|
+
def flatten_query_params(params, parent_key = nil)
|
|
179
|
+
result = {}
|
|
180
|
+
params.each do |key, value|
|
|
181
|
+
full_key = parent_key ? "#{parent_key}[#{key}]" : key.to_s
|
|
182
|
+
|
|
183
|
+
if value.is_a?(Hash)
|
|
184
|
+
result.merge!(flatten_query_params(value, full_key))
|
|
185
|
+
else
|
|
186
|
+
result[full_key] = value
|
|
187
|
+
end
|
|
188
|
+
end
|
|
189
|
+
result
|
|
190
|
+
end
|
|
191
|
+
|
|
178
192
|
def build_request_body(record)
|
|
179
193
|
return nil if record.request_content_type.nil?
|
|
180
194
|
return nil if record.status >= 400
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rspec-openapi
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.23.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Takashi Kokubun
|
|
@@ -112,7 +112,7 @@ licenses:
|
|
|
112
112
|
metadata:
|
|
113
113
|
homepage_uri: https://github.com/exoego/rspec-openapi
|
|
114
114
|
source_code_uri: https://github.com/exoego/rspec-openapi
|
|
115
|
-
changelog_uri: https://github.com/exoego/rspec-openapi/releases/tag/v0.
|
|
115
|
+
changelog_uri: https://github.com/exoego/rspec-openapi/releases/tag/v0.23.0
|
|
116
116
|
rubygems_mfa_required: 'true'
|
|
117
117
|
rdoc_options: []
|
|
118
118
|
require_paths:
|