json_schema 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/json_schema/validator.rb +3 -3
- data/test/json_schema/validator_test.rb +0 -10
- 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: 7e8787587141b0db7b6aa5b94a55ea79c1033136
|
4
|
+
data.tar.gz: 053257c0da80f8729d30784a8d60adfdee208cd2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5edd2fd7082b669c9df06ea9b628dd5caa58027cba8b5041908dc6211111a6b4e0bec65ef256f470f875b20984fa7535f5712024fcfaa88141e8bc2a90ac6ace
|
7
|
+
data.tar.gz: 15296350dfd5f30a2187b3f6da5327210c9d8e83fb9718638275beee049ec18d8b119d264dc50f92954a4fefe76d484e0105d16070aef2e3f2c5cc11352c11be
|
@@ -34,11 +34,11 @@ module JsonSchema
|
|
34
34
|
private
|
35
35
|
|
36
36
|
def first_visit(schema, errors, path)
|
37
|
-
|
37
|
+
path_string = path.join("/")
|
38
38
|
pointer = schema.pointer
|
39
|
-
if !@visits.key?(pointer) || !@visits[pointer].key?(
|
39
|
+
if !@visits.key?(pointer) || !@visits[pointer].key?(path_string)
|
40
40
|
@visits[pointer] ||= {}
|
41
|
-
@visits[pointer][
|
41
|
+
@visits[pointer][path_string] = true
|
42
42
|
true
|
43
43
|
else
|
44
44
|
message = %{Validation loop detected.}
|
@@ -25,16 +25,6 @@ describe JsonSchema::Validator do
|
|
25
25
|
%{Expected data to be a member of enum ["private", "public"], value was: personal.}
|
26
26
|
end
|
27
27
|
|
28
|
-
it "validates enum unsuccessfully with boolean" do
|
29
|
-
pointer("#/definitions/app/definitions/visibility").merge!(
|
30
|
-
"enum" => [true]
|
31
|
-
)
|
32
|
-
data_sample["visibility"] = false
|
33
|
-
refute validate
|
34
|
-
assert_includes error_messages,
|
35
|
-
%{Expected data to be a member of enum [true], value was: false.}
|
36
|
-
end
|
37
|
-
|
38
28
|
it "validates type successfully" do
|
39
29
|
pointer("#/definitions/app").merge!(
|
40
30
|
"type" => ["object"]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: json_schema
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brandur
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-07-
|
11
|
+
date: 2014-07-24 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email:
|