blumquist 0.3.0 → 0.3.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
  SHA1:
3
- metadata.gz: fc1879163c3a69fbfd3790e9be1e3a702429efa0
4
- data.tar.gz: 9ba85c4383afcc83343cfe46d3cc6489605ba9fd
3
+ metadata.gz: 249b88b4bc80ec7543759b3b0700d7cfe9f04b3a
4
+ data.tar.gz: 3cbb84ab029425323f711d3d210e2db223a9574a
5
5
  SHA512:
6
- metadata.gz: a612a42a7947923848e9b78e06131e02c59b70bfa9021926a12c1b14a3d417a0b65d04a4ae2062f7a7509fd8881a0e3b9e71c47e8b94e98eb850ccd1a5f9cee5
7
- data.tar.gz: d403bda45208090896a0c5d489b3c4b9567aaea22ac67edc4761226e0c3174a696b7eac29b1cf951cea73f2a37372f3147d970d73969ecb82ef5a382144eb11b
6
+ metadata.gz: 770dda447195fd81228acecef7d578f12cdc3a6eecad0768bca384db7696739180b8e9adf4bacbc6cc414892a099abe2a6050016ca2fb0a9e3ded07156cf613c
7
+ data.tar.gz: 092f9723612e3625538b50919773b46491ec8fcb80ff48bc0dad65d3a859153b3b35e4b1614dd200e5ddf1fa1d2047001faad4aef6853ecb25fa2eac14f01975
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 0.3.1
2
+ - support array type definitions that are expressed as an object
3
+ or as an array of objects
4
+
1
5
  # 0.3.0
2
6
  - important whitespace changes
3
7
  - proper exceptions
data/lib/blumquist.rb CHANGED
@@ -92,7 +92,18 @@ class Blumquist
92
92
  end
93
93
 
94
94
  def blumquistify_array(property)
95
- item_schema = resolve_json_pointer!(@schema[:properties][property][:items])
95
+ # We only support arrays with one type defined, either through
96
+ #
97
+ # "type": "array",
98
+ # "items": { "$ref": "#/definitions/mytype" }
99
+ #
100
+ # or through
101
+ #
102
+ # "type": "array",
103
+ # "items": [{ "$ref": "#/definitions/mytype" }]
104
+ #
105
+ pointer = [@schema[:properties][property][:items]].flatten.first
106
+ item_schema = resolve_json_pointer!(pointer)
96
107
  raise(Errors::MissingArrayItemsType, @schema[:properties][property]) unless item_schema
97
108
  sub_schema = item_schema.merge(
98
109
  definitions: @schema[:definitions]
@@ -1,3 +1,3 @@
1
1
  class Blumquist
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blumquist
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jannis Hermanns
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-11 00:00:00.000000000 Z
11
+ date: 2015-11-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport