lacerda 2.1.4.beta1 → 2.1.4.beta2

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: 19b05d38440fd072d0007dea89ce2d9918ceb457
4
- data.tar.gz: cf090174559cad51fd3fc811feeaba8963b7cef0
3
+ metadata.gz: 71c56c5058384e3ab9389f6633dd510b9d50498d
4
+ data.tar.gz: 04fce6e09bec4144382033f2d5bd3729ff54b72e
5
5
  SHA512:
6
- metadata.gz: 5d9448fde020aad2ce929c3027f038bfaf66d3cd008c4b33038cc2d24517b43d271340fc6bb7055c0d34511a7b29093044dc8aa84e93ec6826f32761b26d9d62
7
- data.tar.gz: f2f184248f2a47d2cd7db01fd788a8da85abffa38b68fa4aaa8547f619dc7c98c98646077d679485219e655768ebea358ad23dc683fdcdc5e119a648560fc5a5
6
+ metadata.gz: e48c02b02612199cf19193617522f7611b5731e65b970189c682cb31cf1b2d9e9480f584ac484136beccdda97035dfabf1d03768418fb747c5bad629e26d4b75
7
+ data.tar.gz: fdd53fed2a48fa3fdb4cff036303befcae886247d65059b68245bd32afa8a2ec50dbdf20e51137bc40257a89181aa2e75cd55c38d7848afaad8f9ce17cdefeac
@@ -1,6 +1,7 @@
1
- # [2.1.4.beta1] - 2017-09-27
1
+ # [2.1.4.beta1] - 2017-09-28
2
2
  ### Fixed
3
3
  - Fix json schema inclusion for `required` fields
4
+ - Update how we compare array item types, do not allow array as types.
4
5
 
5
6
  # [2.1.3] - 2017-09-15
6
7
  ### Fixed
@@ -9,6 +9,7 @@ module Lacerda
9
9
  :ERR_MISSING_REQUIRED => "The published object has an optional property that you marked as required in your specification.",
10
10
  :ERR_MISSING_TYPE_AND_REF_AND_ONE_OF => 'A property has to either have a "type", "oneOf" or "$ref" property.',
11
11
  :ERR_TYPE_MISMATCH => "The published object has a property with a different type than the consumer's specification.",
12
+ :ERR_NOT_IMPLEMENTED => "Not implemented.",
12
13
  :ERR_NOT_SUPPORTED => 'I don\'t yet know what to do when the consumer\'s specification has a "$ref" defined and the publisher\'s specification has a "type".'
13
14
  }
14
15
 
@@ -168,15 +169,13 @@ module Lacerda
168
169
  end
169
170
  end
170
171
 
171
- if consume['type'] == 'array'
172
- publish['items'].each do |publish_item|
173
- matched = consume['items'].any? do |consume_item|
174
- schema_contains?(publish: publish_item, consume: consume_item)
175
- end
176
- return _e(:ERR_ARRAY_ITEM_MISMATCH, location, nil) unless matched
172
+ if consume['type'] == 'array' && publish['type'] == 'array'
173
+ if !consume['items'].is_a?(Hash) || !publish['items'].is_a?(Hash)
174
+ return _e(:ERR_NOT_IMPLEMENTED, location, "'items' can only be hash (schema)")
175
+ elsif !schema_contains?(publish: publish['items'], consume: consume['items'])
176
+ return _e(:ERR_ARRAY_ITEM_MISMATCH, location, nil)
177
177
  end
178
178
  end
179
-
180
179
  true
181
180
  end
182
181
 
@@ -1,3 +1,3 @@
1
1
  module Lacerda
2
- VERSION = '2.1.4.beta1'
2
+ VERSION = '2.1.4.beta2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lacerda
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.4.beta1
4
+ version: 2.1.4.beta2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jannis Hermanns
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-09-27 00:00:00.000000000 Z
11
+ date: 2017-09-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport