rack-json_schema 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/rack/json_schema/response_validation.rb +12 -1
- data/lib/rack/json_schema/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 41f8287d3451b2c931c11e3a97fe178bb8492e78
|
4
|
+
data.tar.gz: 4d65340993f231235b36b7e5aa0accd80f9e2e06
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d7a782f3eb739cbcf32400d202cc6518e5740e2209ff858992fa89491d5f7ef7a39a316beaf305c2a7b3f4dad5065c04cb74591d6cf4660397e6570b51ce1e6c
|
7
|
+
data.tar.gz: c0a326a2a4e83edf3ae2ecd147886c4370027088e241aac17b23f526d2eb01aa1ad3b14fe2ad25eb62ecea9664b4bd8f2b0f7ae83d3f052a160e081d74bebb5e
|
data/CHANGELOG.md
CHANGED
@@ -31,7 +31,7 @@ module Rack
|
|
31
31
|
# Raises an error if any error detected, skipping validation for non-defined link
|
32
32
|
# @raise [Rack::JsonSchema::ResponseValidation::InvalidResponse]
|
33
33
|
def call
|
34
|
-
if has_link_for_current_action?
|
34
|
+
if !has_error_status? && has_link_for_current_action?
|
35
35
|
case
|
36
36
|
when !has_json_content_type?
|
37
37
|
raise InvalidResponseContentType
|
@@ -82,6 +82,17 @@ module Rack
|
|
82
82
|
@response[2].each {|str| result << str }
|
83
83
|
result
|
84
84
|
end
|
85
|
+
|
86
|
+
# @return [Fixnum] Response status code
|
87
|
+
def response_status
|
88
|
+
@response[0]
|
89
|
+
end
|
90
|
+
|
91
|
+
# Skips validation if status code is equal to or larger than 400
|
92
|
+
# @return [Fixnum]
|
93
|
+
def has_error_status?
|
94
|
+
response_status >= 400
|
95
|
+
end
|
85
96
|
end
|
86
97
|
|
87
98
|
# Base error class for Rack::JsonSchema::ResponseValidation
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-json_schema
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryo Nakamura
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-07-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: erubis
|