open_api-rspec 0.1.6 → 0.1.7

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
  SHA256:
3
- metadata.gz: 3741968c9b4462297e6b5133bbfeb867925a9a66ffeb6df80071a0d59092eac2
4
- data.tar.gz: 7d1a054818ed563c3dfc0e12c59ff928429e28149090cf63bb4f96d83b75a614
3
+ metadata.gz: fc4da8b6e860b0992daf1b33d972ad7cd15b78a9465675e8112c13a48841ed78
4
+ data.tar.gz: 9089cd5f2f76a521a6dbfe588663f1c2be4ef2bd369451fb36d801b2bbb2f1af
5
5
  SHA512:
6
- metadata.gz: 36034881ca126efae00820d2820e173c2e2eef1416213e43c3b0e5a2994d698d0eef712c3a222966c76e558a4fcf0e6cafbd3dc9e60687786dbb475c1b3b0af6
7
- data.tar.gz: 9f1bff37f4299fb0672b5bc1dae5d0df04024e5313dd77752d26f9d620b449b2391c2b73a79e2823d321b456eb1bc932c817ab80866753d012359400e5db8f16
6
+ metadata.gz: 3b16666cd3f2899098aa3f4f4e9f735b389e4d440d6480c738fcf382a828e91ff813404e4ef5c42debdeb882fe3c0288f97fbd3e6837e110be39d462d12a2549
7
+ data.tar.gz: b2ded7a64be1339957bba72b95f079764be0eaa8f415a9123f5324eccf0032272db2d41aa8f3e01e2aff3e2c6f7a2fe8d0334662673aef9240a8d56235dd78fc
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- open_api-rspec (0.1.6)
4
+ open_api-rspec (0.1.7)
5
5
  activesupport
6
6
  open_api-schema_validator
7
7
  rspec
@@ -138,23 +138,19 @@ module OpenApi
138
138
  end
139
139
 
140
140
  def openapi_form_data_params
141
- schema_for_url_and_request_method_form_data_parameters.flat_map do |p|
142
- if p['schema'].present?
143
- keys = p['schema']['properties'].flat_map do |k, v|
144
- deep_body_keys(k, v)
145
- end
146
- keys.map { |key| "#{p['name']}##{key}" }
147
- else
148
- p['name'].to_s
149
- end
150
- end
141
+ schema_for_url_and_request_method_form_data_parameters.map { |p| p['name'].to_s }
151
142
  end
152
143
 
153
144
  def openapi_body_params
154
145
  schema_for_url_and_request_method_body_parameters.flat_map do |p|
155
146
  if p['schema'].present?
156
- scheme = p['schema']['$ref'].tr('/', ' ')[2..-1].strip.split.map(&:to_s)
157
- body = @openapi_schema.dig(*scheme)
147
+ body = if p['schema']['$ref']
148
+ scheme = p['schema']['$ref'].tr('/', ' ')[2..-1].strip.split.map(&:to_s)
149
+ @openapi_schema.dig(*scheme)
150
+ else
151
+ p['schema']
152
+ end
153
+
158
154
  body['properties'].flat_map do |k, v|
159
155
  deep_body_keys(k, v)
160
156
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module OpenApi
4
4
  module RSpec
5
- VERSION = '0.1.6'
5
+ VERSION = '0.1.7'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: open_api-rspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Hansen