oas_parser 0.22.0 → 0.22.1

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: 6a795a90855a50c8b40272a0b477fb50b2e42e8b79d6e8502f9091ad663c554c
4
- data.tar.gz: 06f38aed03780fb777e29868764c20f9094908f03b1bbdd7714da177598e671f
3
+ metadata.gz: 76d67b535e2ea975f89df9bc0440cb5f4c176fad970ece20d8792f81a44caa7b
4
+ data.tar.gz: 3b8f4ae92a913b517b9098627a8267c43ec8bc5129d87f8fd0cc9c003731ae8f
5
5
  SHA512:
6
- metadata.gz: a1fd1b7db5bb75d128d4c94683101bba170a81e627a24207ae43af2dd7e177d23aeaaf48dd0986e6032a3b0922f07faccfce4444f57d7004d403122a9d9fd402
7
- data.tar.gz: 8190c304a4ca1e0e8b7c725332ec38a736c93fdb253e3adc8d604969f10d571b760d24910f2378c1c67b5f6232b33eb8cd91766921e18d4b639192c0eac2c3ea
6
+ metadata.gz: d3100b1f9a841df3d4953e42a77e6b0d52680615678fb464d473e58e840386c4234035db2d6aeea86285b9310227893450b0a9ccf527b394b9ae8bfe9651c48a
7
+ data.tar.gz: 60965b90d1918f979446029da36940b201cf9afc51b860ccd5211f4fe3c372a747026d3a0eb7fd024a431e357b47514ef9c0dfadd40abf66a2ad818afeeaf658
@@ -136,6 +136,15 @@ module OasParser
136
136
  end
137
137
  end
138
138
 
139
+ if object['items'] && object['items']['oneOf']
140
+ items = object['items']['oneOf'].map do |obj|
141
+ route(obj)
142
+ end
143
+
144
+ items.push({ '__array_attributes' => attributes }) if attributes.any? && @mode == 'xml'
145
+ return items
146
+ end
147
+
139
148
  case object['items']['type']
140
149
  when 'object'
141
150
  if attributes.any? && @mode == 'xml'
@@ -145,19 +154,13 @@ module OasParser
145
154
  end
146
155
  else
147
156
  if object['items']
148
- if object['items']['oneOf']
149
- object['items']['oneOf'].map do |obj|
150
- route(obj)
151
- end
157
+ # Handle objects with missing type
158
+ object['items']['type'] = 'object'
159
+ if @mode == 'xml'
160
+ [parse_object(object['items']), { '__array_attributes' => attributes }]
152
161
  else
153
- # Handle objects with missing type
154
- object['items']['type'] = 'object'
155
- if @mode == 'xml'
156
- [parse_object(object['items']), { '__array_attributes' => attributes }]
157
- else
158
- [parse_object(object['items'])]
159
- end
160
- end
162
+ [parse_object(object['items'])]
163
+ end
161
164
  else
162
165
  raise StandardError.new("parse_array: Don't know how to parse object")
163
166
  end
@@ -1,3 +1,3 @@
1
1
  module OasParser
2
- VERSION = '0.22.0'.freeze
2
+ VERSION = '0.22.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oas_parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.22.0
4
+ version: 0.22.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Butler