json-schema 2.4.1 → 2.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +6 -14
- data/README.textile +58 -7
- data/lib/json-schema.rb +3 -1
- data/lib/json-schema/attributes/additionalitems.rb +14 -11
- data/lib/json-schema/attributes/additionalproperties.rb +33 -43
- data/lib/json-schema/attributes/anyof.rb +4 -0
- data/lib/json-schema/attributes/dependencies.rb +31 -19
- data/lib/json-schema/attributes/disallow.rb +2 -3
- data/lib/json-schema/attributes/divisibleby.rb +11 -7
- data/lib/json-schema/attributes/enum.rb +14 -16
- data/lib/json-schema/attributes/format.rb +4 -7
- data/lib/json-schema/attributes/formats/date_time_v4.rb +5 -8
- data/lib/json-schema/attributes/formats/ip.rb +41 -0
- data/lib/json-schema/attributes/formats/uri.rb +10 -8
- data/lib/json-schema/attributes/items.rb +15 -16
- data/lib/json-schema/attributes/limit.rb +179 -0
- data/lib/json-schema/attributes/maxdecimal.rb +7 -6
- data/lib/json-schema/attributes/multipleof.rb +4 -11
- data/lib/json-schema/attributes/not.rb +1 -1
- data/lib/json-schema/attributes/oneof.rb +15 -6
- data/lib/json-schema/attributes/pattern.rb +7 -6
- data/lib/json-schema/attributes/patternproperties.rb +9 -12
- data/lib/json-schema/attributes/properties.rb +55 -39
- data/lib/json-schema/attributes/properties_optional.rb +13 -12
- data/lib/json-schema/attributes/ref.rb +4 -4
- data/lib/json-schema/attributes/required.rb +16 -13
- data/lib/json-schema/attributes/type.rb +13 -18
- data/lib/json-schema/attributes/type_v4.rb +11 -18
- data/lib/json-schema/attributes/uniqueitems.rb +5 -7
- data/lib/json-schema/schema.rb +8 -8
- data/lib/json-schema/schema/#validator.rb# +37 -0
- data/lib/json-schema/schema/reader.rb +113 -0
- data/lib/json-schema/util/uri.rb +16 -0
- data/lib/json-schema/validator.rb +123 -128
- data/lib/json-schema/validators/draft1.rb +1 -1
- data/lib/json-schema/validators/draft2.rb +1 -1
- data/lib/json-schema/validators/draft3.rb +1 -1
- data/lib/json-schema/validators/draft4.rb +1 -1
- data/lib/json-schema/validators/hyper-draft4.rb +1 -1
- data/test/schemas/address_microformat.json +18 -0
- data/test/schemas/definition_schema.json +15 -0
- data/test/schemas/ref john with spaces schema.json +11 -0
- data/test/schemas/relative_definition_schema.json +8 -0
- data/test/test_all_of_ref_schema.rb +12 -15
- data/test/test_any_of_ref_schema.rb +7 -9
- data/test/test_bad_schema_ref.rb +18 -12
- data/test/test_common_test_suite.rb +45 -29
- data/test/test_custom_format.rb +2 -3
- data/test/test_definition.rb +15 -0
- data/test/test_extended_schema.rb +25 -31
- data/test/test_extends_and_additionalProperties.rb +23 -21
- data/test/test_files_v3.rb +14 -23
- data/test/test_fragment_resolution.rb +6 -7
- data/test/test_fragment_validation_with_ref.rb +2 -8
- data/test/test_full_validation.rb +2 -3
- data/test/test_helper.rb +46 -1
- data/test/test_initialize_data.rb +118 -0
- data/test/test_jsonschema_draft1.rb +48 -600
- data/test/test_jsonschema_draft2.rb +48 -699
- data/test/test_jsonschema_draft3.rb +91 -861
- data/test/test_jsonschema_draft4.rb +173 -812
- data/test/test_list_option.rb +6 -7
- data/test/{test_merge_misisng_values.rb → test_merge_missing_values.rb} +2 -3
- data/test/test_minitems.rb +2 -4
- data/test/test_one_of.rb +9 -19
- data/test/test_ruby_schema.rb +5 -14
- data/test/test_schema_loader.rb +74 -0
- data/test/test_schema_type_attribute.rb +2 -3
- data/test/test_schema_validation.rb +4 -5
- data/test/test_stringify.rb +2 -3
- data/test/test_uri_related.rb +67 -0
- data/test/test_validator.rb +53 -0
- metadata +129 -51
- data/lib/json-schema/attributes/dependencies_v4.rb +0 -27
- data/lib/json-schema/attributes/formats/ip4.rb +0 -20
- data/lib/json-schema/attributes/formats/ip6.rb +0 -20
- data/lib/json-schema/attributes/maximum.rb +0 -17
- data/lib/json-schema/attributes/maximum_inclusive.rb +0 -17
- data/lib/json-schema/attributes/maxitems.rb +0 -14
- data/lib/json-schema/attributes/maxlength.rb +0 -16
- data/lib/json-schema/attributes/maxproperties.rb +0 -14
- data/lib/json-schema/attributes/minimum.rb +0 -17
- data/lib/json-schema/attributes/minimum_inclusive.rb +0 -17
- data/lib/json-schema/attributes/minitems.rb +0 -14
- data/lib/json-schema/attributes/minlength.rb +0 -16
- data/lib/json-schema/attributes/minproperties.rb +0 -14
- data/lib/json-schema/attributes/properties_v4.rb +0 -58
- data/lib/json-schema/uri/file.rb +0 -36
data/test/test_list_option.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
|
-
require '
|
2
|
-
require File.dirname(__FILE__) + '/../lib/json-schema'
|
1
|
+
require File.expand_path('../test_helper', __FILE__)
|
3
2
|
|
4
|
-
class ListOptionTest < Test
|
3
|
+
class ListOptionTest < Minitest::Test
|
5
4
|
def test_list_option_reusing_schemas
|
6
5
|
schema_hash = {
|
7
6
|
"$schema" => "http://json-schema.org/draft-04/schema#",
|
@@ -9,14 +8,14 @@ class ListOptionTest < Test::Unit::TestCase
|
|
9
8
|
"properties" => { "a" => { "type" => "integer" } }
|
10
9
|
}
|
11
10
|
|
12
|
-
uri = URI.parse('http://example.com/item')
|
11
|
+
uri = Addressable::URI.parse('http://example.com/item')
|
13
12
|
schema = JSON::Schema.new(schema_hash, uri)
|
14
13
|
JSON::Validator.add_schema(schema)
|
15
14
|
|
16
15
|
data = {"a" => 1}
|
17
|
-
|
16
|
+
assert_valid uri.to_s, data
|
18
17
|
|
19
18
|
data = [{"a" => 1}]
|
20
|
-
|
19
|
+
assert_valid uri.to_s, data, :list => true
|
21
20
|
end
|
22
|
-
end
|
21
|
+
end
|
@@ -1,7 +1,6 @@
|
|
1
|
-
require '
|
2
|
-
require File.dirname(__FILE__) + '/../lib/json-schema'
|
1
|
+
require File.expand_path('../test_helper', __FILE__)
|
3
2
|
|
4
|
-
class MergeMissingValuesTest < Test
|
3
|
+
class MergeMissingValuesTest < Minitest::Test
|
5
4
|
def test_merge_missing_values_for_string
|
6
5
|
original = 'foo'
|
7
6
|
updated = 'foo'
|
data/test/test_minitems.rb
CHANGED
@@ -1,14 +1,12 @@
|
|
1
|
-
require '
|
2
|
-
require File.dirname(__FILE__) + '/../lib/json-schema'
|
1
|
+
require File.expand_path('../test_helper', __FILE__)
|
3
2
|
|
4
|
-
class MinItemsTest < Test
|
3
|
+
class MinItemsTest < Minitest::Test
|
5
4
|
def test_minitems_nils
|
6
5
|
schema = {
|
7
6
|
"type" => "array",
|
8
7
|
"minItems" => 1,
|
9
8
|
"items" => { "type" => "object" }
|
10
9
|
}
|
11
|
-
data = [nil]
|
12
10
|
|
13
11
|
errors = JSON::Validator.fully_validate(schema, [nil])
|
14
12
|
assert_equal(errors.length, 1)
|
data/test/test_one_of.rb
CHANGED
@@ -1,15 +1,12 @@
|
|
1
|
-
require '
|
2
|
-
require File.dirname(__FILE__) + '/../lib/json-schema'
|
1
|
+
require File.expand_path('../test_helper', __FILE__)
|
3
2
|
|
4
|
-
class OneOfTest < Test
|
3
|
+
class OneOfTest < Minitest::Test
|
5
4
|
def test_one_of_links_schema
|
6
|
-
schema =
|
7
|
-
data
|
8
|
-
|
9
|
-
assert(errors.empty?, errors.map{|e| e[:message] }.join("\n"))
|
5
|
+
schema = schema_fixture_path('one_of_ref_links_schema.json')
|
6
|
+
data = data_fixture_path('one_of_ref_links_data.json')
|
7
|
+
assert_valid schema, data
|
10
8
|
end
|
11
9
|
|
12
|
-
|
13
10
|
def test_one_of_with_string_patterns
|
14
11
|
schema = {
|
15
12
|
"$schema" => "http://json-schema.org/draft-04/schema#",
|
@@ -26,17 +23,10 @@ class OneOfTest < Test::Unit::TestCase
|
|
26
23
|
]
|
27
24
|
}
|
28
25
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
assert(!JSON::Validator.validate(schema,data))
|
34
|
-
|
35
|
-
data = {"a" => "baz"}
|
36
|
-
assert(JSON::Validator.validate(schema,data))
|
37
|
-
|
38
|
-
data = {"a" => 5}
|
39
|
-
assert(!JSON::Validator.validate(schema,data))
|
26
|
+
assert_valid schema, { "a" => "foo" }
|
27
|
+
refute_valid schema, { "a" => "foobar" }
|
28
|
+
assert_valid schema, { "a" => "baz" }
|
29
|
+
refute_valid schema, { "a" => 5 }
|
40
30
|
end
|
41
31
|
|
42
32
|
end
|
data/test/test_ruby_schema.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
|
-
require '
|
2
|
-
require File.dirname(__FILE__) + '/../lib/json-schema'
|
1
|
+
require File.expand_path('../test_helper', __FILE__)
|
3
2
|
|
4
|
-
class RubySchemaTest < Test
|
3
|
+
class RubySchemaTest < Minitest::Test
|
5
4
|
def test_string_keys
|
6
5
|
schema = {
|
7
6
|
"type" => 'object',
|
@@ -12,11 +11,7 @@ class RubySchemaTest < Test::Unit::TestCase
|
|
12
11
|
}
|
13
12
|
}
|
14
13
|
|
15
|
-
|
16
|
-
"a" => 5
|
17
|
-
}
|
18
|
-
|
19
|
-
assert(JSON::Validator.validate(schema, data))
|
14
|
+
assert_valid schema, { "a" => 5 }
|
20
15
|
end
|
21
16
|
|
22
17
|
def test_symbol_keys
|
@@ -29,11 +24,7 @@ class RubySchemaTest < Test::Unit::TestCase
|
|
29
24
|
}
|
30
25
|
}
|
31
26
|
|
32
|
-
|
33
|
-
:a => 5
|
34
|
-
}
|
35
|
-
|
36
|
-
assert(JSON::Validator.validate(schema, data))
|
27
|
+
assert_valid schema, { :a => 5 }
|
37
28
|
end
|
38
29
|
|
39
30
|
def test_symbol_keys_in_hash_within_array
|
@@ -63,6 +54,6 @@ class RubySchemaTest < Test::Unit::TestCase
|
|
63
54
|
]
|
64
55
|
}
|
65
56
|
|
66
|
-
|
57
|
+
assert_valid schema, data, :validate_schema => true
|
67
58
|
end
|
68
59
|
end
|
@@ -0,0 +1,74 @@
|
|
1
|
+
require File.expand_path('../test_helper', __FILE__)
|
2
|
+
|
3
|
+
class TestSchemaReader < Minitest::Test
|
4
|
+
ADDRESS_SCHEMA_URI = 'http://json-schema.org/address'
|
5
|
+
ADDRESS_SCHEMA_PATH = File.expand_path('../schemas/address_microformat.json', __FILE__)
|
6
|
+
|
7
|
+
def stub_address_request(body = File.read(ADDRESS_SCHEMA_PATH))
|
8
|
+
stub_request(:get, ADDRESS_SCHEMA_URI).
|
9
|
+
to_return(:body => body, :status => 200)
|
10
|
+
end
|
11
|
+
|
12
|
+
def test_accept_all_uris
|
13
|
+
stub_address_request
|
14
|
+
|
15
|
+
reader = JSON::Schema::Reader.new
|
16
|
+
schema = reader.read(ADDRESS_SCHEMA_URI)
|
17
|
+
|
18
|
+
assert_equal schema.uri, Addressable::URI.parse("#{ADDRESS_SCHEMA_URI}#")
|
19
|
+
end
|
20
|
+
|
21
|
+
def test_accept_all_files
|
22
|
+
reader = JSON::Schema::Reader.new
|
23
|
+
schema = reader.read(ADDRESS_SCHEMA_PATH)
|
24
|
+
|
25
|
+
assert_equal schema.uri, Addressable::URI.convert_path(ADDRESS_SCHEMA_PATH + '#')
|
26
|
+
end
|
27
|
+
|
28
|
+
def test_refuse_all_uris
|
29
|
+
reader = JSON::Schema::Reader.new(:accept_uri => false)
|
30
|
+
refute reader.accept_uri?(Addressable::URI.parse('http://foo.com'))
|
31
|
+
end
|
32
|
+
|
33
|
+
def test_refuse_all_files
|
34
|
+
reader = JSON::Schema::Reader.new(:accept_file => false)
|
35
|
+
refute reader.accept_file?(Pathname.new('/foo/bar/baz'))
|
36
|
+
end
|
37
|
+
|
38
|
+
def test_accept_uri_proc
|
39
|
+
reader = JSON::Schema::Reader.new(
|
40
|
+
:accept_uri => proc { |uri| uri.host == 'json-schema.org' }
|
41
|
+
)
|
42
|
+
|
43
|
+
assert reader.accept_uri?(Addressable::URI.parse('http://json-schema.org/address'))
|
44
|
+
refute reader.accept_uri?(Addressable::URI.parse('http://sub.json-schema.org/address'))
|
45
|
+
end
|
46
|
+
|
47
|
+
def test_accept_file_proc
|
48
|
+
test_root = Pathname.new(__FILE__).expand_path.dirname
|
49
|
+
|
50
|
+
reader = JSON::Schema::Reader.new(
|
51
|
+
:accept_file => proc { |path| path.to_s.start_with?(test_root.to_s) }
|
52
|
+
)
|
53
|
+
|
54
|
+
assert reader.accept_file?(test_root.join('anything.json'))
|
55
|
+
refute reader.accept_file?(test_root.join('..', 'anything.json'))
|
56
|
+
end
|
57
|
+
|
58
|
+
def test_file_scheme
|
59
|
+
reader = JSON::Schema::Reader.new(:accept_uri => true, :accept_file => false)
|
60
|
+
assert_raises(JSON::Schema::ReadRefused) do
|
61
|
+
reader.read('file://' + ADDRESS_SCHEMA_PATH)
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
def test_parse_error
|
66
|
+
stub_address_request('this is totally not valid JSON!')
|
67
|
+
|
68
|
+
reader = JSON::Schema::Reader.new
|
69
|
+
|
70
|
+
assert_raises(parser_error) do
|
71
|
+
reader.read(ADDRESS_SCHEMA_URI)
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
@@ -1,7 +1,6 @@
|
|
1
|
-
require '
|
2
|
-
require File.dirname(__FILE__) + '/../lib/json-schema'
|
1
|
+
require File.expand_path('../test_helper', __FILE__)
|
3
2
|
|
4
|
-
class TestSchemaTypeAttribute < Test
|
3
|
+
class TestSchemaTypeAttribute < Minitest::Test
|
5
4
|
def test_type_of_data
|
6
5
|
assert_equal(type_of_data(String.new), 'string')
|
7
6
|
assert_equal(type_of_data(Numeric.new), 'number')
|
@@ -1,8 +1,7 @@
|
|
1
|
-
require '
|
1
|
+
require File.expand_path('../test_helper', __FILE__)
|
2
2
|
require 'tmpdir'
|
3
|
-
require File.dirname(__FILE__) + '/../lib/json-schema'
|
4
3
|
|
5
|
-
class JSONSchemaValidation < Test
|
4
|
+
class JSONSchemaValidation < Minitest::Test
|
6
5
|
def valid_schema_v3
|
7
6
|
{
|
8
7
|
"$schema" => "http://json-schema.org/draft-03/schema#",
|
@@ -135,7 +134,7 @@ class JSONSchemaValidation < Test::Unit::TestCase
|
|
135
134
|
|
136
135
|
errors = JSON::Validator.fully_validate_schema(invalid_schema_v3, :version => :draft3)
|
137
136
|
assert_equal 1, errors.size
|
138
|
-
assert_match
|
137
|
+
assert_match(/the property .*required.*did not match/i, errors.first)
|
139
138
|
end
|
140
139
|
|
141
140
|
|
@@ -151,7 +150,7 @@ class JSONSchemaValidation < Test::Unit::TestCase
|
|
151
150
|
|
152
151
|
errors = JSON::Validator.fully_validate_schema(invalid_schema_v4, :version => :draft4)
|
153
152
|
assert_equal 1, errors.size
|
154
|
-
assert_match
|
153
|
+
assert_match(/the property .*required.*did not match/i, errors.first)
|
155
154
|
end
|
156
155
|
|
157
156
|
def test_validate_schema_3_without_version_option
|
data/test/test_stringify.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
|
-
require '
|
2
|
-
require File.dirname(__FILE__) + '/../lib/json-schema'
|
1
|
+
require File.expand_path('../test_helper', __FILE__)
|
3
2
|
|
4
|
-
class StringifyTest < Test
|
3
|
+
class StringifyTest < Minitest::Test
|
5
4
|
def test_stringify_on_hash
|
6
5
|
hash = {
|
7
6
|
:a => 'foo',
|
@@ -0,0 +1,67 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
require File.expand_path('../test_helper', __FILE__)
|
3
|
+
|
4
|
+
class UriRelatedTest < Minitest::Test
|
5
|
+
def test_asian_characters
|
6
|
+
schema = {
|
7
|
+
"$schema"=> "http://json-schema.org/draft-04/schema#",
|
8
|
+
"id"=> "http://俺:鍵@例え.テスト/p?条件#ここ#",
|
9
|
+
"type" => "object",
|
10
|
+
"required" => ["a"],
|
11
|
+
"properties" => {
|
12
|
+
"a" => {
|
13
|
+
"id" => "a",
|
14
|
+
"type" => "integer"
|
15
|
+
}
|
16
|
+
}
|
17
|
+
}
|
18
|
+
data = { "a" => 5 }
|
19
|
+
assert_valid schema, data
|
20
|
+
end
|
21
|
+
|
22
|
+
def test_schema_ref_with_empty_fragment
|
23
|
+
schema = {
|
24
|
+
"$schema" => "http://json-schema.org/draft-04/schema#",
|
25
|
+
"type" => "object",
|
26
|
+
"required" => ["names"],
|
27
|
+
"properties"=> {
|
28
|
+
"names"=> {
|
29
|
+
"type"=> "array",
|
30
|
+
"items"=> {
|
31
|
+
"anyOf"=> [
|
32
|
+
{ "$ref" => "test/schemas/ref john with spaces schema.json#" },
|
33
|
+
]
|
34
|
+
}
|
35
|
+
}
|
36
|
+
}
|
37
|
+
}
|
38
|
+
data = {"names" => [{"first" => "john"}]}
|
39
|
+
assert_valid schema, data
|
40
|
+
end
|
41
|
+
|
42
|
+
def test_schema_ref_from_file_with_spaces
|
43
|
+
schema = {
|
44
|
+
"$schema" => "http://json-schema.org/draft-04/schema#",
|
45
|
+
"type" => "object",
|
46
|
+
"required" => ["names"],
|
47
|
+
"properties"=> {
|
48
|
+
"names"=> {
|
49
|
+
"type"=> "array",
|
50
|
+
"items"=> {
|
51
|
+
"anyOf"=> [
|
52
|
+
{ "$ref" => "test/schemas/ref john with spaces schema.json" }
|
53
|
+
]
|
54
|
+
}
|
55
|
+
}
|
56
|
+
}
|
57
|
+
}
|
58
|
+
data = {"names" => [{"first" => "john"}]}
|
59
|
+
assert_valid schema, data
|
60
|
+
end
|
61
|
+
|
62
|
+
def test_schema_from_file_with_spaces
|
63
|
+
data = {"first" => "john"}
|
64
|
+
schema = "test/schemas/ref john with spaces schema.json"
|
65
|
+
assert_valid schema, data
|
66
|
+
end
|
67
|
+
end
|
@@ -0,0 +1,53 @@
|
|
1
|
+
require File.expand_path('../test_helper', __FILE__)
|
2
|
+
|
3
|
+
class TestValidator < Minitest::Test
|
4
|
+
|
5
|
+
class MockReader
|
6
|
+
def read(location)
|
7
|
+
schema = {
|
8
|
+
'$schema' => 'http://json-schema.org/draft-04/schema#',
|
9
|
+
'type' => 'string',
|
10
|
+
'minLength' => 2
|
11
|
+
}
|
12
|
+
|
13
|
+
JSON::Schema.new(schema, Addressable::URI.parse(location.to_s))
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
def setup
|
18
|
+
@original_reader = JSON::Validator.schema_reader
|
19
|
+
end
|
20
|
+
|
21
|
+
def teardown
|
22
|
+
JSON::Validator.schema_reader = @original_reader
|
23
|
+
end
|
24
|
+
|
25
|
+
def test_default_schema_reader
|
26
|
+
reader = JSON::Validator.schema_reader
|
27
|
+
assert reader.accept_uri?(Addressable::URI.parse('http://example.com'))
|
28
|
+
assert reader.accept_file?(Pathname.new('/etc/passwd'))
|
29
|
+
end
|
30
|
+
|
31
|
+
def test_set_default_schema_reader
|
32
|
+
JSON::Validator.schema_reader = MockReader.new
|
33
|
+
|
34
|
+
schema = { '$ref' => 'http://any.url/at/all' }
|
35
|
+
assert_valid schema, 'abc'
|
36
|
+
refute_valid schema, 'a'
|
37
|
+
end
|
38
|
+
|
39
|
+
def test_validate_with_reader
|
40
|
+
reader = MockReader.new
|
41
|
+
schema = { '$ref' => 'http://any.url/at/all' }
|
42
|
+
assert_valid schema, 'abc', :schema_reader => reader
|
43
|
+
refute_valid schema, 'a', :schema_reader => reader
|
44
|
+
end
|
45
|
+
|
46
|
+
def test_validate_list_with_reader
|
47
|
+
reader = MockReader.new
|
48
|
+
schema = { '$ref' => 'http://what.ever/schema' }
|
49
|
+
assert_valid schema, ['abc', 'def'], :schema_reader => reader, :list => true
|
50
|
+
refute_valid schema, ['abc', 'a'], :schema_reader => reader, :list => true
|
51
|
+
end
|
52
|
+
|
53
|
+
end
|
metadata
CHANGED
@@ -1,15 +1,85 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: json-schema
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kenny Hoxworth
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
12
|
-
dependencies:
|
11
|
+
date: 2014-12-03 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rake
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: minitest
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '5.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '5.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: webmock
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: bundler
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: addressable
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '2.3'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '2.3'
|
13
83
|
description:
|
14
84
|
email: hoxworth@gmail.com
|
15
85
|
executables: []
|
@@ -18,13 +88,15 @@ extra_rdoc_files:
|
|
18
88
|
- README.textile
|
19
89
|
- LICENSE.md
|
20
90
|
files:
|
91
|
+
- LICENSE.md
|
92
|
+
- README.textile
|
93
|
+
- lib/json-schema.rb
|
21
94
|
- lib/json-schema/attribute.rb
|
22
95
|
- lib/json-schema/attributes/additionalitems.rb
|
23
96
|
- lib/json-schema/attributes/additionalproperties.rb
|
24
97
|
- lib/json-schema/attributes/allof.rb
|
25
98
|
- lib/json-schema/attributes/anyof.rb
|
26
99
|
- lib/json-schema/attributes/dependencies.rb
|
27
|
-
- lib/json-schema/attributes/dependencies_v4.rb
|
28
100
|
- lib/json-schema/attributes/disallow.rb
|
29
101
|
- lib/json-schema/attributes/divisibleby.rb
|
30
102
|
- lib/json-schema/attributes/enum.rb
|
@@ -34,22 +106,12 @@ files:
|
|
34
106
|
- lib/json-schema/attributes/formats/date.rb
|
35
107
|
- lib/json-schema/attributes/formats/date_time.rb
|
36
108
|
- lib/json-schema/attributes/formats/date_time_v4.rb
|
37
|
-
- lib/json-schema/attributes/formats/
|
38
|
-
- lib/json-schema/attributes/formats/ip6.rb
|
109
|
+
- lib/json-schema/attributes/formats/ip.rb
|
39
110
|
- lib/json-schema/attributes/formats/time.rb
|
40
111
|
- lib/json-schema/attributes/formats/uri.rb
|
41
112
|
- lib/json-schema/attributes/items.rb
|
113
|
+
- lib/json-schema/attributes/limit.rb
|
42
114
|
- lib/json-schema/attributes/maxdecimal.rb
|
43
|
-
- lib/json-schema/attributes/maximum.rb
|
44
|
-
- lib/json-schema/attributes/maximum_inclusive.rb
|
45
|
-
- lib/json-schema/attributes/maxitems.rb
|
46
|
-
- lib/json-schema/attributes/maxlength.rb
|
47
|
-
- lib/json-schema/attributes/maxproperties.rb
|
48
|
-
- lib/json-schema/attributes/minimum.rb
|
49
|
-
- lib/json-schema/attributes/minimum_inclusive.rb
|
50
|
-
- lib/json-schema/attributes/minitems.rb
|
51
|
-
- lib/json-schema/attributes/minlength.rb
|
52
|
-
- lib/json-schema/attributes/minproperties.rb
|
53
115
|
- lib/json-schema/attributes/multipleof.rb
|
54
116
|
- lib/json-schema/attributes/not.rb
|
55
117
|
- lib/json-schema/attributes/oneof.rb
|
@@ -57,7 +119,6 @@ files:
|
|
57
119
|
- lib/json-schema/attributes/patternproperties.rb
|
58
120
|
- lib/json-schema/attributes/properties.rb
|
59
121
|
- lib/json-schema/attributes/properties_optional.rb
|
60
|
-
- lib/json-schema/attributes/properties_v4.rb
|
61
122
|
- lib/json-schema/attributes/ref.rb
|
62
123
|
- lib/json-schema/attributes/required.rb
|
63
124
|
- lib/json-schema/attributes/type.rb
|
@@ -67,10 +128,12 @@ files:
|
|
67
128
|
- lib/json-schema/errors/json_parse_error.rb
|
68
129
|
- lib/json-schema/errors/schema_error.rb
|
69
130
|
- lib/json-schema/errors/validation_error.rb
|
70
|
-
- lib/json-schema/schema/validator.rb
|
71
131
|
- lib/json-schema/schema.rb
|
72
|
-
- lib/json-schema/
|
132
|
+
- lib/json-schema/schema/#validator.rb#
|
133
|
+
- lib/json-schema/schema/reader.rb
|
134
|
+
- lib/json-schema/schema/validator.rb
|
73
135
|
- lib/json-schema/util/array_set.rb
|
136
|
+
- lib/json-schema/util/uri.rb
|
74
137
|
- lib/json-schema/util/uuid.rb
|
75
138
|
- lib/json-schema/validator.rb
|
76
139
|
- lib/json-schema/validators/draft1.rb
|
@@ -78,48 +141,23 @@ files:
|
|
78
141
|
- lib/json-schema/validators/draft3.rb
|
79
142
|
- lib/json-schema/validators/draft4.rb
|
80
143
|
- lib/json-schema/validators/hyper-draft4.rb
|
81
|
-
- lib/json-schema.rb
|
82
144
|
- resources/draft-01.json
|
83
145
|
- resources/draft-02.json
|
84
146
|
- resources/draft-03.json
|
85
147
|
- resources/draft-04.json
|
86
|
-
- README.textile
|
87
|
-
- LICENSE.md
|
88
|
-
- test/test_all_of_ref_schema.rb
|
89
|
-
- test/test_any_of_ref_schema.rb
|
90
|
-
- test/test_bad_schema_ref.rb
|
91
|
-
- test/test_common_test_suite.rb
|
92
|
-
- test/test_custom_format.rb
|
93
|
-
- test/test_extended_schema.rb
|
94
|
-
- test/test_extends_and_additionalProperties.rb
|
95
|
-
- test/test_files_v3.rb
|
96
|
-
- test/test_fragment_resolution.rb
|
97
|
-
- test/test_fragment_validation_with_ref.rb
|
98
|
-
- test/test_full_validation.rb
|
99
|
-
- test/test_helper.rb
|
100
|
-
- test/test_jsonschema_draft1.rb
|
101
|
-
- test/test_jsonschema_draft2.rb
|
102
|
-
- test/test_jsonschema_draft3.rb
|
103
|
-
- test/test_jsonschema_draft4.rb
|
104
|
-
- test/test_list_option.rb
|
105
|
-
- test/test_merge_misisng_values.rb
|
106
|
-
- test/test_minitems.rb
|
107
|
-
- test/test_one_of.rb
|
108
|
-
- test/test_ruby_schema.rb
|
109
|
-
- test/test_schema_type_attribute.rb
|
110
|
-
- test/test_schema_validation.rb
|
111
|
-
- test/test_stringify.rb
|
112
148
|
- test/data/all_of_ref_data.json
|
113
149
|
- test/data/any_of_ref_data.json
|
114
150
|
- test/data/bad_data_1.json
|
115
151
|
- test/data/good_data_1.json
|
116
152
|
- test/data/one_of_ref_links_data.json
|
153
|
+
- test/schemas/address_microformat.json
|
117
154
|
- test/schemas/all_of_ref_base_schema.json
|
118
155
|
- test/schemas/all_of_ref_schema.json
|
119
156
|
- test/schemas/any_of_ref_jane_schema.json
|
120
157
|
- test/schemas/any_of_ref_jimmy_schema.json
|
121
158
|
- test/schemas/any_of_ref_john_schema.json
|
122
159
|
- test/schemas/any_of_ref_schema.json
|
160
|
+
- test/schemas/definition_schema.json
|
123
161
|
- test/schemas/extends_and_additionalProperties-1-filename.schema.json
|
124
162
|
- test/schemas/extends_and_additionalProperties-1-ref.schema.json
|
125
163
|
- test/schemas/extends_and_additionalProperties-2-filename.schema.json
|
@@ -130,9 +168,40 @@ files:
|
|
130
168
|
- test/schemas/good_schema_extends2.json
|
131
169
|
- test/schemas/inner.schema.json
|
132
170
|
- test/schemas/one_of_ref_links_schema.json
|
171
|
+
- test/schemas/ref john with spaces schema.json
|
172
|
+
- test/schemas/relative_definition_schema.json
|
133
173
|
- test/schemas/self_link_schema.json
|
134
174
|
- test/schemas/up_link_schema.json
|
135
|
-
|
175
|
+
- test/test_all_of_ref_schema.rb
|
176
|
+
- test/test_any_of_ref_schema.rb
|
177
|
+
- test/test_bad_schema_ref.rb
|
178
|
+
- test/test_common_test_suite.rb
|
179
|
+
- test/test_custom_format.rb
|
180
|
+
- test/test_definition.rb
|
181
|
+
- test/test_extended_schema.rb
|
182
|
+
- test/test_extends_and_additionalProperties.rb
|
183
|
+
- test/test_files_v3.rb
|
184
|
+
- test/test_fragment_resolution.rb
|
185
|
+
- test/test_fragment_validation_with_ref.rb
|
186
|
+
- test/test_full_validation.rb
|
187
|
+
- test/test_helper.rb
|
188
|
+
- test/test_initialize_data.rb
|
189
|
+
- test/test_jsonschema_draft1.rb
|
190
|
+
- test/test_jsonschema_draft2.rb
|
191
|
+
- test/test_jsonschema_draft3.rb
|
192
|
+
- test/test_jsonschema_draft4.rb
|
193
|
+
- test/test_list_option.rb
|
194
|
+
- test/test_merge_missing_values.rb
|
195
|
+
- test/test_minitems.rb
|
196
|
+
- test/test_one_of.rb
|
197
|
+
- test/test_ruby_schema.rb
|
198
|
+
- test/test_schema_loader.rb
|
199
|
+
- test/test_schema_type_attribute.rb
|
200
|
+
- test/test_schema_validation.rb
|
201
|
+
- test/test_stringify.rb
|
202
|
+
- test/test_uri_related.rb
|
203
|
+
- test/test_validator.rb
|
204
|
+
homepage: http://github.com/ruby-json-schema/json-schema/tree/master
|
136
205
|
licenses:
|
137
206
|
- MIT
|
138
207
|
metadata: {}
|
@@ -142,17 +211,17 @@ require_paths:
|
|
142
211
|
- lib
|
143
212
|
required_ruby_version: !ruby/object:Gem::Requirement
|
144
213
|
requirements:
|
145
|
-
- -
|
214
|
+
- - ">="
|
146
215
|
- !ruby/object:Gem::Version
|
147
216
|
version: 1.8.7
|
148
217
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
149
218
|
requirements:
|
150
|
-
- -
|
219
|
+
- - ">="
|
151
220
|
- !ruby/object:Gem::Version
|
152
221
|
version: '1.8'
|
153
222
|
requirements: []
|
154
223
|
rubyforge_project:
|
155
|
-
rubygems_version: 2.
|
224
|
+
rubygems_version: 2.2.2
|
156
225
|
signing_key:
|
157
226
|
specification_version: 4
|
158
227
|
summary: Ruby JSON Schema Validator
|
@@ -162,6 +231,7 @@ test_files:
|
|
162
231
|
- test/test_bad_schema_ref.rb
|
163
232
|
- test/test_common_test_suite.rb
|
164
233
|
- test/test_custom_format.rb
|
234
|
+
- test/test_definition.rb
|
165
235
|
- test/test_extended_schema.rb
|
166
236
|
- test/test_extends_and_additionalProperties.rb
|
167
237
|
- test/test_files_v3.rb
|
@@ -169,29 +239,35 @@ test_files:
|
|
169
239
|
- test/test_fragment_validation_with_ref.rb
|
170
240
|
- test/test_full_validation.rb
|
171
241
|
- test/test_helper.rb
|
242
|
+
- test/test_initialize_data.rb
|
172
243
|
- test/test_jsonschema_draft1.rb
|
173
244
|
- test/test_jsonschema_draft2.rb
|
174
245
|
- test/test_jsonschema_draft3.rb
|
175
246
|
- test/test_jsonschema_draft4.rb
|
176
247
|
- test/test_list_option.rb
|
177
|
-
- test/
|
248
|
+
- test/test_merge_missing_values.rb
|
178
249
|
- test/test_minitems.rb
|
179
250
|
- test/test_one_of.rb
|
180
251
|
- test/test_ruby_schema.rb
|
252
|
+
- test/test_schema_loader.rb
|
181
253
|
- test/test_schema_type_attribute.rb
|
182
254
|
- test/test_schema_validation.rb
|
183
255
|
- test/test_stringify.rb
|
256
|
+
- test/test_uri_related.rb
|
257
|
+
- test/test_validator.rb
|
184
258
|
- test/data/all_of_ref_data.json
|
185
259
|
- test/data/any_of_ref_data.json
|
186
260
|
- test/data/bad_data_1.json
|
187
261
|
- test/data/good_data_1.json
|
188
262
|
- test/data/one_of_ref_links_data.json
|
263
|
+
- test/schemas/address_microformat.json
|
189
264
|
- test/schemas/all_of_ref_base_schema.json
|
190
265
|
- test/schemas/all_of_ref_schema.json
|
191
266
|
- test/schemas/any_of_ref_jane_schema.json
|
192
267
|
- test/schemas/any_of_ref_jimmy_schema.json
|
193
268
|
- test/schemas/any_of_ref_john_schema.json
|
194
269
|
- test/schemas/any_of_ref_schema.json
|
270
|
+
- test/schemas/definition_schema.json
|
195
271
|
- test/schemas/extends_and_additionalProperties-1-filename.schema.json
|
196
272
|
- test/schemas/extends_and_additionalProperties-1-ref.schema.json
|
197
273
|
- test/schemas/extends_and_additionalProperties-2-filename.schema.json
|
@@ -202,5 +278,7 @@ test_files:
|
|
202
278
|
- test/schemas/good_schema_extends2.json
|
203
279
|
- test/schemas/inner.schema.json
|
204
280
|
- test/schemas/one_of_ref_links_schema.json
|
281
|
+
- test/schemas/ref john with spaces schema.json
|
282
|
+
- test/schemas/relative_definition_schema.json
|
205
283
|
- test/schemas/self_link_schema.json
|
206
284
|
- test/schemas/up_link_schema.json
|