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 +4 -4
- data/CHANGELOG.markdown +2 -1
- data/lib/lacerda/compare/json_schema.rb +16 -6
- data/lib/lacerda/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a807acc73bace0f06ff5bf9bb62991eba9f93dfc
|
4
|
+
data.tar.gz: d9b6720d89815ec353ccfc5cd462365eb17577ca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b5b37c5e2e799942ed9121b5a3eac91c9204c70a8423a42531c2ff4d8e5235a9fd6899760886a060ea00932253f800ddd1bf3afc728fb99cc26c15315cc99153
|
7
|
+
data.tar.gz: 3fba51c4b13b1e2e7e81290e4e193ef96ff54d9311bd512eefb8260e3a586ed2681bd81856938debf60812e2f72832e8cb26a834bfe4e682f360ad2e88c5476a
|
data/CHANGELOG.markdown
CHANGED
@@ -1,7 +1,8 @@
|
|
1
|
-
# [2.1.4.
|
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
|
-
|
130
|
-
|
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
|
-
|
278
|
-
|
279
|
-
result
|
288
|
+
comparator.schema_contains?(publish: resolved_containing, consume: resolved_contained)
|
289
|
+
comparator.errors
|
280
290
|
end
|
281
291
|
end
|
282
292
|
end
|
data/lib/lacerda/version.rb
CHANGED