oas_parser 0.21.1 → 0.22.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e51178200a7b0bbbf43781a767c8e1e489b31f56e9da281c130768268576366a
4
- data.tar.gz: 87d301aa8974e25476c8644cbbd48163f0dd4b7bbbb02f12b33aa65b97302ad0
3
+ metadata.gz: 6a795a90855a50c8b40272a0b477fb50b2e42e8b79d6e8502f9091ad663c554c
4
+ data.tar.gz: 06f38aed03780fb777e29868764c20f9094908f03b1bbdd7714da177598e671f
5
5
  SHA512:
6
- metadata.gz: 292943e8352a03735e49b83a3132cb5c89e264742a38700fbfd248c37e20808a2689d8c4aaa3a023476e96ebf8243546887e47b6b4680099a08213716bfc5665
7
- data.tar.gz: b6fe8ece8fa561cb1ddf858887e3c2a1ddcd3304aed4dd804dcfe0ccf258ea854d8e547bde60b283ba9528e16b2268c1298b19748865973064333e1f7ba8a449
6
+ metadata.gz: a1fd1b7db5bb75d128d4c94683101bba170a81e627a24207ae43af2dd7e177d23aeaaf48dd0986e6032a3b0922f07faccfce4444f57d7004d403122a9d9fd402
7
+ data.tar.gz: 8190c304a4ca1e0e8b7c725332ec38a736c93fdb253e3adc8d604969f10d571b760d24910f2378c1c67b5f6232b33eb8cd91766921e18d4b639192c0eac2c3ea
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- oas_parser (0.21.0)
4
+ oas_parser (0.22.0)
5
5
  activesupport (>= 4.0.0)
6
6
  addressable (~> 2.3)
7
7
  builder (~> 3.2.3)
@@ -69,6 +69,8 @@ module OasParser
69
69
  parse_object(root_object)
70
70
  when 'array' then parse_array(root_object)
71
71
  when 'string' then root_object['example']
72
+ when 'integer' then root_object['example']
73
+ when 'number' then root_object['example']
72
74
  when nil
73
75
  return nil if root_object['additionalProperties'] == false
74
76
  return nil if root_object['properties'] == {}
@@ -143,13 +145,19 @@ module OasParser
143
145
  end
144
146
  else
145
147
  if object['items']
146
- # Handle objects with missing type
147
- object['items']['type'] = 'object'
148
- if @mode == 'xml'
149
- [parse_object(object['items']), { '__array_attributes' => attributes }]
148
+ if object['items']['oneOf']
149
+ object['items']['oneOf'].map do |obj|
150
+ route(obj)
151
+ end
150
152
  else
151
- [parse_object(object['items'])]
152
- end
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
153
161
  else
154
162
  raise StandardError.new("parse_array: Don't know how to parse object")
155
163
  end
@@ -1,3 +1,3 @@
1
1
  module OasParser
2
- VERSION = '0.21.1'.freeze
2
+ VERSION = '0.22.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oas_parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.21.1
4
+ version: 0.22.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Butler
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-09-06 00:00:00.000000000 Z
11
+ date: 2019-09-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable