lacerda 2.1.4.beta2 → 2.1.4.beta3

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: 71c56c5058384e3ab9389f6633dd510b9d50498d
4
- data.tar.gz: 04fce6e09bec4144382033f2d5bd3729ff54b72e
3
+ metadata.gz: a807acc73bace0f06ff5bf9bb62991eba9f93dfc
4
+ data.tar.gz: d9b6720d89815ec353ccfc5cd462365eb17577ca
5
5
  SHA512:
6
- metadata.gz: e48c02b02612199cf19193617522f7611b5731e65b970189c682cb31cf1b2d9e9480f584ac484136beccdda97035dfabf1d03768418fb747c5bad629e26d4b75
7
- data.tar.gz: fdd53fed2a48fa3fdb4cff036303befcae886247d65059b68245bd32afa8a2ec50dbdf20e51137bc40257a89181aa2e75cd55c38d7848afaad8f9ce17cdefeac
6
+ metadata.gz: b5b37c5e2e799942ed9121b5a3eac91c9204c70a8423a42531c2ff4d8e5235a9fd6899760886a060ea00932253f800ddd1bf3afc728fb99cc26c15315cc99153
7
+ data.tar.gz: 3fba51c4b13b1e2e7e81290e4e193ef96ff54d9311bd512eefb8260e3a586ed2681bd81856938debf60812e2f72832e8cb26a834bfe4e682f360ad2e88c5476a
@@ -1,7 +1,8 @@
1
- # [2.1.4.beta1] - 2017-09-28
1
+ # [2.1.4.beta3] - 2017-09-28
2
2
  ### Fixed
3
3
  - Fix json schema inclusion for `required` fields
4
4
  - Update how we compare array item types, do not allow array as types.
5
+ - Bubble up errors for oneOfs of one type
5
6
 
6
7
  # [2.1.3] - 2017-09-15
7
8
  ### Fixed
@@ -126,10 +126,21 @@ module Lacerda
126
126
 
127
127
  # Check all publish types for a compatible consume type
128
128
  publish_types.each do |publish_type|
129
- matched = consume_types.any? do |consume_type|
130
- compare_sub_types(publish_type, consume_type, location + [publish_type])
129
+ errors = []
130
+ consume_types.any? do |consume_type|
131
+ errors = compare_sub_types(publish_type, consume_type, location + [publish_type])
132
+ errors.empty?
133
+ end
134
+ if errors.any?
135
+ # As there is only one type in each oneOf, we can give more specific error.
136
+ # TODO: add this to other cases
137
+ if publish_types.size == 1 && consume_types.size == 1
138
+ @errors.push(*errors)
139
+ else
140
+ _e(:ERR_MISSING_MULTI_PUBLISH_MULTI_CONSUME, location, publish_type)
141
+ end
142
+ return false
131
143
  end
132
- return _e(:ERR_MISSING_MULTI_PUBLISH_MULTI_CONSUME, location, publish_type) if !matched
133
144
  end
134
145
 
135
146
  # Mixed case 1/2:
@@ -274,9 +285,8 @@ module Lacerda
274
285
  'properties' => { 'bar' => { '$ref' => '#/definitions/foo' } }
275
286
  }
276
287
  comparator = self.class.new(containing_schema)
277
- # TODO we need errorrs to bubble up here
278
- result = comparator.schema_contains?(publish: resolved_containing, consume: resolved_contained)
279
- result
288
+ comparator.schema_contains?(publish: resolved_containing, consume: resolved_contained)
289
+ comparator.errors
280
290
  end
281
291
  end
282
292
  end
@@ -1,3 +1,3 @@
1
1
  module Lacerda
2
- VERSION = '2.1.4.beta2'
2
+ VERSION = '2.1.4.beta3'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lacerda
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.4.beta2
4
+ version: 2.1.4.beta3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jannis Hermanns