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 +4 -4
- data/lib/oas_parser/response_parser.rb +15 -12
- data/lib/oas_parser/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 76d67b535e2ea975f89df9bc0440cb5f4c176fad970ece20d8792f81a44caa7b
|
4
|
+
data.tar.gz: 3b8f4ae92a913b517b9098627a8267c43ec8bc5129d87f8fd0cc9c003731ae8f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
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
|
-
|
154
|
-
|
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
|
data/lib/oas_parser/version.rb
CHANGED