rack-json_schema 1.1.1 → 1.1.2

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: 41f8287d3451b2c931c11e3a97fe178bb8492e78
4
- data.tar.gz: 4d65340993f231235b36b7e5aa0accd80f9e2e06
3
+ metadata.gz: 7c359a173c8a15742899c048066568b9ba4e9dcc
4
+ data.tar.gz: 868a647466e9df56fd41302f74f4f768fbdccddd
5
5
  SHA512:
6
- metadata.gz: d7a782f3eb739cbcf32400d202cc6518e5740e2209ff858992fa89491d5f7ef7a39a316beaf305c2a7b3f4dad5065c04cb74591d6cf4660397e6570b51ce1e6c
7
- data.tar.gz: c0a326a2a4e83edf3ae2ecd147886c4370027088e241aac17b23f526d2eb01aa1ad3b14fe2ad25eb62ecea9664b4bd8f2b0f7ae83d3f052a160e081d74bebb5e
6
+ metadata.gz: 31755c67da66e679a28434d7bc2fae80d1532dd56404f9a9419410e83dfd2047181c5b444dce1449d465bf24a9d74d1633df767df3b4ee078fa81cb2e582e252
7
+ data.tar.gz: 5220e8a448947182e56bf153969181ba0aa9fe81bee99b6abb943c5b13064a31d2292a9410100e6b62b3ea7949a98c0bb668fb5173ce518f14a8d63549909ea3
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 1.1.2
2
+ * Support an empty array response at response validation
3
+
1
4
  ## 1.1.1
2
5
  * Skip response validation if response code is 4xx or 5xx
3
6
 
@@ -48,7 +48,7 @@ module Rack
48
48
 
49
49
  # @return [true, false] True if given data is valid to the JSON schema
50
50
  def valid?
51
- validator.validate(example_item)
51
+ (has_list_data? && data.empty?) || validator.validate(example_item)
52
52
  end
53
53
 
54
54
  # @return [Hash] Choose an item from response data, to be validated
@@ -1,5 +1,5 @@
1
1
  module Rack
2
2
  module JsonSchema
3
- VERSION = "1.1.1"
3
+ VERSION = "1.1.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-json_schema
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryo Nakamura