json-schema 3.0.0 → 4.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/README.md +15 -1
- data/lib/json-schema/attribute.rb +13 -14
- data/lib/json-schema/attributes/additionalitems.rb +1 -0
- data/lib/json-schema/attributes/additionalproperties.rb +3 -6
- data/lib/json-schema/attributes/allof.rb +6 -4
- data/lib/json-schema/attributes/anyof.rb +2 -2
- data/lib/json-schema/attributes/dependencies.rb +1 -0
- data/lib/json-schema/attributes/disallow.rb +2 -1
- data/lib/json-schema/attributes/enum.rb +2 -2
- data/lib/json-schema/attributes/extends.rb +6 -6
- data/lib/json-schema/attributes/format.rb +2 -1
- data/lib/json-schema/attributes/formats/date.rb +1 -0
- data/lib/json-schema/attributes/formats/date_time.rb +2 -1
- data/lib/json-schema/attributes/formats/date_time_v4.rb +1 -0
- data/lib/json-schema/attributes/formats/uri.rb +1 -0
- data/lib/json-schema/attributes/items.rb +1 -0
- data/lib/json-schema/attributes/limits/numeric.rb +1 -1
- data/lib/json-schema/attributes/maxdecimal.rb +1 -1
- data/lib/json-schema/attributes/not.rb +2 -2
- data/lib/json-schema/attributes/oneof.rb +2 -4
- data/lib/json-schema/attributes/patternproperties.rb +1 -0
- data/lib/json-schema/attributes/properties.rb +7 -7
- data/lib/json-schema/attributes/properties_v4.rb +1 -1
- data/lib/json-schema/attributes/propertynames.rb +23 -0
- data/lib/json-schema/attributes/ref.rb +7 -7
- data/lib/json-schema/attributes/required.rb +3 -2
- data/lib/json-schema/attributes/type.rb +3 -2
- data/lib/json-schema/attributes/type_v4.rb +1 -1
- data/lib/json-schema/errors/validation_error.rb +4 -5
- data/lib/json-schema/schema/reader.rb +2 -0
- data/lib/json-schema/schema/validator.rb +3 -3
- data/lib/json-schema/schema.rb +3 -4
- data/lib/json-schema/util/array_set.rb +1 -1
- data/lib/json-schema/util/uri.rb +7 -7
- data/lib/json-schema/util/uuid.rb +227 -226
- data/lib/json-schema/validator.rb +97 -84
- data/lib/json-schema/validators/draft1.rb +21 -23
- data/lib/json-schema/validators/draft2.rb +22 -24
- data/lib/json-schema/validators/draft3.rb +26 -28
- data/lib/json-schema/validators/draft4.rb +34 -36
- data/lib/json-schema/validators/draft6.rb +36 -37
- data/lib/json-schema/validators/hyper-draft1.rb +2 -3
- data/lib/json-schema/validators/hyper-draft2.rb +2 -3
- data/lib/json-schema/validators/hyper-draft3.rb +2 -3
- data/lib/json-schema/validators/hyper-draft4.rb +2 -3
- data/lib/json-schema/validators/hyper-draft6.rb +2 -3
- data/lib/json-schema.rb +2 -2
- data/resources/draft-06.json +12 -12
- metadata +7 -6
| @@ -2,32 +2,31 @@ require 'json-schema/schema/validator' | |
| 2 2 |  | 
| 3 3 | 
             
            module JSON
         | 
| 4 4 | 
             
              class Schema
         | 
| 5 | 
            -
             | 
| 6 5 | 
             
                class Draft3 < Validator
         | 
| 7 6 | 
             
                  def initialize
         | 
| 8 7 | 
             
                    super
         | 
| 9 8 | 
             
                    @attributes = {
         | 
| 10 | 
            -
                       | 
| 11 | 
            -
                       | 
| 12 | 
            -
                       | 
| 13 | 
            -
                       | 
| 14 | 
            -
                       | 
| 15 | 
            -
                       | 
| 16 | 
            -
                       | 
| 17 | 
            -
                       | 
| 18 | 
            -
                       | 
| 19 | 
            -
                       | 
| 20 | 
            -
                       | 
| 21 | 
            -
                       | 
| 22 | 
            -
                       | 
| 23 | 
            -
                       | 
| 24 | 
            -
                       | 
| 25 | 
            -
                       | 
| 26 | 
            -
                       | 
| 27 | 
            -
                       | 
| 28 | 
            -
                       | 
| 29 | 
            -
                       | 
| 30 | 
            -
                       | 
| 9 | 
            +
                      'type' => JSON::Schema::TypeAttribute,
         | 
| 10 | 
            +
                      'disallow' => JSON::Schema::DisallowAttribute,
         | 
| 11 | 
            +
                      'format' => JSON::Schema::FormatAttribute,
         | 
| 12 | 
            +
                      'maximum' => JSON::Schema::MaximumAttribute,
         | 
| 13 | 
            +
                      'minimum' => JSON::Schema::MinimumAttribute,
         | 
| 14 | 
            +
                      'minItems' => JSON::Schema::MinItemsAttribute,
         | 
| 15 | 
            +
                      'maxItems' => JSON::Schema::MaxItemsAttribute,
         | 
| 16 | 
            +
                      'uniqueItems' => JSON::Schema::UniqueItemsAttribute,
         | 
| 17 | 
            +
                      'minLength' => JSON::Schema::MinLengthAttribute,
         | 
| 18 | 
            +
                      'maxLength' => JSON::Schema::MaxLengthAttribute,
         | 
| 19 | 
            +
                      'divisibleBy' => JSON::Schema::DivisibleByAttribute,
         | 
| 20 | 
            +
                      'enum' => JSON::Schema::EnumAttribute,
         | 
| 21 | 
            +
                      'properties' => JSON::Schema::PropertiesAttribute,
         | 
| 22 | 
            +
                      'pattern' => JSON::Schema::PatternAttribute,
         | 
| 23 | 
            +
                      'patternProperties' => JSON::Schema::PatternPropertiesAttribute,
         | 
| 24 | 
            +
                      'additionalProperties' => JSON::Schema::AdditionalPropertiesAttribute,
         | 
| 25 | 
            +
                      'items' => JSON::Schema::ItemsAttribute,
         | 
| 26 | 
            +
                      'additionalItems' => JSON::Schema::AdditionalItemsAttribute,
         | 
| 27 | 
            +
                      'dependencies' => JSON::Schema::DependenciesAttribute,
         | 
| 28 | 
            +
                      'extends' => JSON::Schema::ExtendsAttribute,
         | 
| 29 | 
            +
                      '$ref' => JSON::Schema::RefAttribute,
         | 
| 31 30 | 
             
                    }
         | 
| 32 31 | 
             
                    @default_formats = {
         | 
| 33 32 | 
             
                      'date-time' => DateTimeFormat,
         | 
| @@ -35,16 +34,15 @@ module JSON | |
| 35 34 | 
             
                      'ip-address' => IP4Format,
         | 
| 36 35 | 
             
                      'ipv6' => IP6Format,
         | 
| 37 36 | 
             
                      'time' => TimeFormat,
         | 
| 38 | 
            -
                      'uri' => UriFormat
         | 
| 37 | 
            +
                      'uri' => UriFormat,
         | 
| 39 38 | 
             
                    }
         | 
| 40 39 | 
             
                    @formats = @default_formats.clone
         | 
| 41 | 
            -
                    @uri = JSON::Util::URI.parse( | 
| 42 | 
            -
                    @names = [ | 
| 43 | 
            -
                    @metaschema_name =  | 
| 40 | 
            +
                    @uri = JSON::Util::URI.parse('http://json-schema.org/draft-03/schema#')
         | 
| 41 | 
            +
                    @names = ['draft3', 'http://json-schema.org/draft-03/schema#']
         | 
| 42 | 
            +
                    @metaschema_name = 'draft-03.json'
         | 
| 44 43 | 
             
                  end
         | 
| 45 44 |  | 
| 46 | 
            -
                  JSON::Validator.register_validator( | 
| 45 | 
            +
                  JSON::Validator.register_validator(new)
         | 
| 47 46 | 
             
                end
         | 
| 48 | 
            -
             | 
| 49 47 | 
             
              end
         | 
| 50 48 | 
             
            end
         | 
| @@ -2,55 +2,53 @@ require 'json-schema/schema/validator' | |
| 2 2 |  | 
| 3 3 | 
             
            module JSON
         | 
| 4 4 | 
             
              class Schema
         | 
| 5 | 
            -
             | 
| 6 5 | 
             
                class Draft4 < Validator
         | 
| 7 6 | 
             
                  def initialize
         | 
| 8 7 | 
             
                    super
         | 
| 9 8 | 
             
                    @attributes = {
         | 
| 10 | 
            -
                       | 
| 11 | 
            -
                       | 
| 12 | 
            -
                       | 
| 13 | 
            -
                       | 
| 14 | 
            -
                       | 
| 15 | 
            -
                       | 
| 16 | 
            -
                       | 
| 17 | 
            -
                       | 
| 18 | 
            -
                       | 
| 19 | 
            -
                       | 
| 20 | 
            -
                       | 
| 21 | 
            -
                       | 
| 22 | 
            -
                       | 
| 23 | 
            -
                       | 
| 24 | 
            -
                       | 
| 25 | 
            -
                       | 
| 26 | 
            -
                       | 
| 27 | 
            -
                       | 
| 28 | 
            -
                       | 
| 29 | 
            -
                       | 
| 30 | 
            -
                       | 
| 31 | 
            -
                       | 
| 32 | 
            -
                       | 
| 33 | 
            -
                       | 
| 34 | 
            -
                       | 
| 35 | 
            -
                       | 
| 36 | 
            -
                       | 
| 37 | 
            -
                       | 
| 9 | 
            +
                      'type' => JSON::Schema::TypeV4Attribute,
         | 
| 10 | 
            +
                      'allOf' => JSON::Schema::AllOfAttribute,
         | 
| 11 | 
            +
                      'anyOf' => JSON::Schema::AnyOfAttribute,
         | 
| 12 | 
            +
                      'oneOf' => JSON::Schema::OneOfAttribute,
         | 
| 13 | 
            +
                      'not' => JSON::Schema::NotAttribute,
         | 
| 14 | 
            +
                      'disallow' => JSON::Schema::DisallowAttribute,
         | 
| 15 | 
            +
                      'format' => JSON::Schema::FormatAttribute,
         | 
| 16 | 
            +
                      'maximum' => JSON::Schema::MaximumAttribute,
         | 
| 17 | 
            +
                      'minimum' => JSON::Schema::MinimumAttribute,
         | 
| 18 | 
            +
                      'minItems' => JSON::Schema::MinItemsAttribute,
         | 
| 19 | 
            +
                      'maxItems' => JSON::Schema::MaxItemsAttribute,
         | 
| 20 | 
            +
                      'minProperties' => JSON::Schema::MinPropertiesAttribute,
         | 
| 21 | 
            +
                      'maxProperties' => JSON::Schema::MaxPropertiesAttribute,
         | 
| 22 | 
            +
                      'uniqueItems' => JSON::Schema::UniqueItemsAttribute,
         | 
| 23 | 
            +
                      'minLength' => JSON::Schema::MinLengthAttribute,
         | 
| 24 | 
            +
                      'maxLength' => JSON::Schema::MaxLengthAttribute,
         | 
| 25 | 
            +
                      'multipleOf' => JSON::Schema::MultipleOfAttribute,
         | 
| 26 | 
            +
                      'enum' => JSON::Schema::EnumAttribute,
         | 
| 27 | 
            +
                      'properties' => JSON::Schema::PropertiesV4Attribute,
         | 
| 28 | 
            +
                      'required' => JSON::Schema::RequiredAttribute,
         | 
| 29 | 
            +
                      'pattern' => JSON::Schema::PatternAttribute,
         | 
| 30 | 
            +
                      'patternProperties' => JSON::Schema::PatternPropertiesAttribute,
         | 
| 31 | 
            +
                      'additionalProperties' => JSON::Schema::AdditionalPropertiesAttribute,
         | 
| 32 | 
            +
                      'items' => JSON::Schema::ItemsAttribute,
         | 
| 33 | 
            +
                      'additionalItems' => JSON::Schema::AdditionalItemsAttribute,
         | 
| 34 | 
            +
                      'dependencies' => JSON::Schema::DependenciesV4Attribute,
         | 
| 35 | 
            +
                      'extends' => JSON::Schema::ExtendsAttribute,
         | 
| 36 | 
            +
                      '$ref' => JSON::Schema::RefAttribute,
         | 
| 38 37 | 
             
                    }
         | 
| 39 38 | 
             
                    @default_formats = {
         | 
| 40 39 | 
             
                      'date-time' => DateTimeV4Format,
         | 
| 41 40 | 
             
                      'ipv4' => IP4Format,
         | 
| 42 41 | 
             
                      'ipv6' => IP6Format,
         | 
| 43 | 
            -
                      'uri' => UriFormat
         | 
| 42 | 
            +
                      'uri' => UriFormat,
         | 
| 44 43 | 
             
                    }
         | 
| 45 44 | 
             
                    @formats = @default_formats.clone
         | 
| 46 | 
            -
                    @uri = JSON::Util::URI.parse( | 
| 47 | 
            -
                    @names = [ | 
| 48 | 
            -
                    @metaschema_name =  | 
| 45 | 
            +
                    @uri = JSON::Util::URI.parse('http://json-schema.org/draft-04/schema#')
         | 
| 46 | 
            +
                    @names = ['draft4', 'http://json-schema.org/draft-04/schema#']
         | 
| 47 | 
            +
                    @metaschema_name = 'draft-04.json'
         | 
| 49 48 | 
             
                  end
         | 
| 50 49 |  | 
| 51 | 
            -
                  JSON::Validator.register_validator( | 
| 52 | 
            -
                  JSON::Validator.register_default_validator( | 
| 50 | 
            +
                  JSON::Validator.register_validator(new)
         | 
| 51 | 
            +
                  JSON::Validator.register_default_validator(new)
         | 
| 53 52 | 
             
                end
         | 
| 54 | 
            -
             | 
| 55 53 | 
             
              end
         | 
| 56 54 | 
             
            end
         | 
| @@ -2,56 +2,55 @@ require 'json-schema/schema/validator' | |
| 2 2 |  | 
| 3 3 | 
             
            module JSON
         | 
| 4 4 | 
             
              class Schema
         | 
| 5 | 
            -
             | 
| 6 5 | 
             
                class Draft6 < Validator
         | 
| 7 6 | 
             
                  def initialize
         | 
| 8 7 | 
             
                    super
         | 
| 9 8 | 
             
                    @attributes = {
         | 
| 10 | 
            -
                       | 
| 11 | 
            -
                       | 
| 12 | 
            -
                       | 
| 13 | 
            -
                       | 
| 14 | 
            -
                       | 
| 15 | 
            -
                       | 
| 16 | 
            -
                       | 
| 17 | 
            -
                       | 
| 18 | 
            -
                       | 
| 19 | 
            -
                       | 
| 20 | 
            -
                       | 
| 21 | 
            -
                       | 
| 22 | 
            -
                       | 
| 23 | 
            -
                       | 
| 24 | 
            -
                       | 
| 25 | 
            -
                       | 
| 26 | 
            -
                       | 
| 27 | 
            -
                       | 
| 28 | 
            -
                       | 
| 29 | 
            -
                       | 
| 30 | 
            -
                       | 
| 31 | 
            -
                       | 
| 32 | 
            -
                       | 
| 33 | 
            -
                       | 
| 34 | 
            -
                       | 
| 35 | 
            -
                       | 
| 36 | 
            -
                       | 
| 37 | 
            -
                       | 
| 38 | 
            -
                       | 
| 9 | 
            +
                      'type' => JSON::Schema::TypeV4Attribute,
         | 
| 10 | 
            +
                      'allOf' => JSON::Schema::AllOfAttribute,
         | 
| 11 | 
            +
                      'anyOf' => JSON::Schema::AnyOfAttribute,
         | 
| 12 | 
            +
                      'oneOf' => JSON::Schema::OneOfAttribute,
         | 
| 13 | 
            +
                      'not' => JSON::Schema::NotAttribute,
         | 
| 14 | 
            +
                      'disallow' => JSON::Schema::DisallowAttribute,
         | 
| 15 | 
            +
                      'format' => JSON::Schema::FormatAttribute,
         | 
| 16 | 
            +
                      'maximum' => JSON::Schema::MaximumAttribute,
         | 
| 17 | 
            +
                      'minimum' => JSON::Schema::MinimumAttribute,
         | 
| 18 | 
            +
                      'minItems' => JSON::Schema::MinItemsAttribute,
         | 
| 19 | 
            +
                      'maxItems' => JSON::Schema::MaxItemsAttribute,
         | 
| 20 | 
            +
                      'minProperties' => JSON::Schema::MinPropertiesAttribute,
         | 
| 21 | 
            +
                      'maxProperties' => JSON::Schema::MaxPropertiesAttribute,
         | 
| 22 | 
            +
                      'uniqueItems' => JSON::Schema::UniqueItemsAttribute,
         | 
| 23 | 
            +
                      'minLength' => JSON::Schema::MinLengthAttribute,
         | 
| 24 | 
            +
                      'maxLength' => JSON::Schema::MaxLengthAttribute,
         | 
| 25 | 
            +
                      'multipleOf' => JSON::Schema::MultipleOfAttribute,
         | 
| 26 | 
            +
                      'enum' => JSON::Schema::EnumAttribute,
         | 
| 27 | 
            +
                      'properties' => JSON::Schema::PropertiesV4Attribute,
         | 
| 28 | 
            +
                      'required' => JSON::Schema::RequiredAttribute,
         | 
| 29 | 
            +
                      'pattern' => JSON::Schema::PatternAttribute,
         | 
| 30 | 
            +
                      'patternProperties' => JSON::Schema::PatternPropertiesAttribute,
         | 
| 31 | 
            +
                      'additionalProperties' => JSON::Schema::AdditionalPropertiesAttribute,
         | 
| 32 | 
            +
                      'items' => JSON::Schema::ItemsAttribute,
         | 
| 33 | 
            +
                      'additionalItems' => JSON::Schema::AdditionalItemsAttribute,
         | 
| 34 | 
            +
                      'dependencies' => JSON::Schema::DependenciesV4Attribute,
         | 
| 35 | 
            +
                      'extends' => JSON::Schema::ExtendsAttribute,
         | 
| 36 | 
            +
                      'const' => JSON::Schema::ConstAttribute,
         | 
| 37 | 
            +
                      '$ref' => JSON::Schema::RefAttribute,
         | 
| 38 | 
            +
                      'propertyNames' => JSON::Schema::PropertyNames,
         | 
| 39 39 | 
             
                    }
         | 
| 40 40 | 
             
                    @default_formats = {
         | 
| 41 41 | 
             
                      'date-time' => DateTimeV4Format,
         | 
| 42 42 | 
             
                      'ipv4' => IP4Format,
         | 
| 43 43 | 
             
                      'ipv6' => IP6Format,
         | 
| 44 | 
            -
                      'uri' => UriFormat
         | 
| 44 | 
            +
                      'uri' => UriFormat,
         | 
| 45 45 | 
             
                    }
         | 
| 46 46 | 
             
                    @formats = @default_formats.clone
         | 
| 47 | 
            -
                    @uri = JSON::Util::URI.parse( | 
| 48 | 
            -
                    @names = [ | 
| 49 | 
            -
                    @metaschema_name =  | 
| 47 | 
            +
                    @uri = JSON::Util::URI.parse('http://json-schema.org/draft-06/schema#')
         | 
| 48 | 
            +
                    @names = ['draft6', 'http://json-schema.org/draft-06/schema#']
         | 
| 49 | 
            +
                    @metaschema_name = 'draft-06.json'
         | 
| 50 50 | 
             
                  end
         | 
| 51 51 |  | 
| 52 | 
            -
                  JSON::Validator.register_validator( | 
| 53 | 
            -
                  JSON::Validator.register_default_validator( | 
| 52 | 
            +
                  JSON::Validator.register_validator(new)
         | 
| 53 | 
            +
                  JSON::Validator.register_default_validator(new)
         | 
| 54 54 | 
             
                end
         | 
| 55 | 
            -
             | 
| 56 55 | 
             
              end
         | 
| 57 56 | 
             
            end
         | 
| @@ -1,13 +1,12 @@ | |
| 1 1 | 
             
            module JSON
         | 
| 2 2 | 
             
              class Schema
         | 
| 3 | 
            -
             | 
| 4 3 | 
             
                class HyperDraft1 < Draft1
         | 
| 5 4 | 
             
                  def initialize
         | 
| 6 5 | 
             
                    super
         | 
| 7 | 
            -
                    @uri = JSON::Util::URI.parse( | 
| 6 | 
            +
                    @uri = JSON::Util::URI.parse('http://json-schema.org/draft-01/hyper-schema#')
         | 
| 8 7 | 
             
                  end
         | 
| 9 8 |  | 
| 10 | 
            -
                  JSON::Validator.register_validator( | 
| 9 | 
            +
                  JSON::Validator.register_validator(new)
         | 
| 11 10 | 
             
                end
         | 
| 12 11 | 
             
              end
         | 
| 13 12 | 
             
            end
         | 
| @@ -1,13 +1,12 @@ | |
| 1 1 | 
             
            module JSON
         | 
| 2 2 | 
             
              class Schema
         | 
| 3 | 
            -
             | 
| 4 3 | 
             
                class HyperDraft2 < Draft2
         | 
| 5 4 | 
             
                  def initialize
         | 
| 6 5 | 
             
                    super
         | 
| 7 | 
            -
                    @uri = JSON::Util::URI.parse( | 
| 6 | 
            +
                    @uri = JSON::Util::URI.parse('http://json-schema.org/draft-02/hyper-schema#')
         | 
| 8 7 | 
             
                  end
         | 
| 9 8 |  | 
| 10 | 
            -
                  JSON::Validator.register_validator( | 
| 9 | 
            +
                  JSON::Validator.register_validator(new)
         | 
| 11 10 | 
             
                end
         | 
| 12 11 | 
             
              end
         | 
| 13 12 | 
             
            end
         | 
| @@ -1,13 +1,12 @@ | |
| 1 1 | 
             
            module JSON
         | 
| 2 2 | 
             
              class Schema
         | 
| 3 | 
            -
             | 
| 4 3 | 
             
                class HyperDraft3 < Draft3
         | 
| 5 4 | 
             
                  def initialize
         | 
| 6 5 | 
             
                    super
         | 
| 7 | 
            -
                    @uri = JSON::Util::URI.parse( | 
| 6 | 
            +
                    @uri = JSON::Util::URI.parse('http://json-schema.org/draft-03/hyper-schema#')
         | 
| 8 7 | 
             
                  end
         | 
| 9 8 |  | 
| 10 | 
            -
                  JSON::Validator.register_validator( | 
| 9 | 
            +
                  JSON::Validator.register_validator(new)
         | 
| 11 10 | 
             
                end
         | 
| 12 11 | 
             
              end
         | 
| 13 12 | 
             
            end
         | 
| @@ -1,13 +1,12 @@ | |
| 1 1 | 
             
            module JSON
         | 
| 2 2 | 
             
              class Schema
         | 
| 3 | 
            -
             | 
| 4 3 | 
             
                class HyperDraft4 < Draft4
         | 
| 5 4 | 
             
                  def initialize
         | 
| 6 5 | 
             
                    super
         | 
| 7 | 
            -
                    @uri = JSON::Util::URI.parse( | 
| 6 | 
            +
                    @uri = JSON::Util::URI.parse('http://json-schema.org/draft-04/hyper-schema#')
         | 
| 8 7 | 
             
                  end
         | 
| 9 8 |  | 
| 10 | 
            -
                  JSON::Validator.register_validator( | 
| 9 | 
            +
                  JSON::Validator.register_validator(new)
         | 
| 11 10 | 
             
                end
         | 
| 12 11 | 
             
              end
         | 
| 13 12 | 
             
            end
         | 
| @@ -1,13 +1,12 @@ | |
| 1 1 | 
             
            module JSON
         | 
| 2 2 | 
             
              class Schema
         | 
| 3 | 
            -
             | 
| 4 3 | 
             
                class HyperDraft6 < Draft6
         | 
| 5 4 | 
             
                  def initialize
         | 
| 6 5 | 
             
                    super
         | 
| 7 | 
            -
                    @uri = JSON::Util::URI.parse( | 
| 6 | 
            +
                    @uri = JSON::Util::URI.parse('http://json-schema.org/draft-06/hyper-schema#')
         | 
| 8 7 | 
             
                  end
         | 
| 9 8 |  | 
| 10 | 
            -
                  JSON::Validator.register_validator( | 
| 9 | 
            +
                  JSON::Validator.register_validator(new)
         | 
| 11 10 | 
             
                end
         | 
| 12 11 | 
             
              end
         | 
| 13 12 | 
             
            end
         | 
    
        data/lib/json-schema.rb
    CHANGED
    
    | @@ -14,5 +14,5 @@ require 'json-schema/schema' | |
| 14 14 | 
             
            require 'json-schema/schema/reader'
         | 
| 15 15 | 
             
            require 'json-schema/validator'
         | 
| 16 16 |  | 
| 17 | 
            -
            Dir[File.join(File.dirname(__FILE__),  | 
| 18 | 
            -
            Dir[File.join(File.dirname(__FILE__),  | 
| 17 | 
            +
            Dir[File.join(File.dirname(__FILE__), 'json-schema/attributes/**/*.rb')].each { |file| require file }
         | 
| 18 | 
            +
            Dir[File.join(File.dirname(__FILE__), 'json-schema/validators/*.rb')].sort!.each { |file| require file }
         | 
    
        data/resources/draft-06.json
    CHANGED
    
    | @@ -1,6 +1,6 @@ | |
| 1 1 | 
             
            {
         | 
| 2 | 
            -
                "$schema": "http://json-schema.org/draft/schema#",
         | 
| 3 | 
            -
                "$id": "http://json-schema.org/draft/schema#",
         | 
| 2 | 
            +
                "$schema": "http://json-schema.org/draft-06/schema#",
         | 
| 3 | 
            +
                "$id": "http://json-schema.org/draft-06/schema#",
         | 
| 4 4 | 
             
                "title": "Core schema meta-schema",
         | 
| 5 5 | 
             
                "definitions": {
         | 
| 6 6 | 
             
                    "schemaArray": {
         | 
| @@ -8,13 +8,13 @@ | |
| 8 8 | 
             
                        "minItems": 1,
         | 
| 9 9 | 
             
                        "items": { "$ref": "#" }
         | 
| 10 10 | 
             
                    },
         | 
| 11 | 
            -
                    " | 
| 11 | 
            +
                    "nonNegativeInteger": {
         | 
| 12 12 | 
             
                        "type": "integer",
         | 
| 13 13 | 
             
                        "minimum": 0
         | 
| 14 14 | 
             
                    },
         | 
| 15 | 
            -
                    " | 
| 15 | 
            +
                    "nonNegativeIntegerDefault0": {
         | 
| 16 16 | 
             
                        "allOf": [
         | 
| 17 | 
            -
                            { "$ref": "#/definitions/ | 
| 17 | 
            +
                            { "$ref": "#/definitions/nonNegativeInteger" },
         | 
| 18 18 | 
             
                            { "default": 0 }
         | 
| 19 19 | 
             
                        ]
         | 
| 20 20 | 
             
                    },
         | 
| @@ -33,7 +33,7 @@ | |
| 33 33 | 
             
                        "type": "array",
         | 
| 34 34 | 
             
                        "items": { "type": "string" },
         | 
| 35 35 | 
             
                        "uniqueItems": true,
         | 
| 36 | 
            -
                        " | 
| 36 | 
            +
                        "default": []
         | 
| 37 37 | 
             
                    }
         | 
| 38 38 | 
             
                },
         | 
| 39 39 | 
             
                "type": ["object", "boolean"],
         | 
| @@ -73,8 +73,8 @@ | |
| 73 73 | 
             
                    "exclusiveMinimum": {
         | 
| 74 74 | 
             
                        "type": "number"
         | 
| 75 75 | 
             
                    },
         | 
| 76 | 
            -
                    "maxLength": { "$ref": "#/definitions/ | 
| 77 | 
            -
                    "minLength": { "$ref": "#/definitions/ | 
| 76 | 
            +
                    "maxLength": { "$ref": "#/definitions/nonNegativeInteger" },
         | 
| 77 | 
            +
                    "minLength": { "$ref": "#/definitions/nonNegativeIntegerDefault0" },
         | 
| 78 78 | 
             
                    "pattern": {
         | 
| 79 79 | 
             
                        "type": "string",
         | 
| 80 80 | 
             
                        "format": "regex"
         | 
| @@ -87,15 +87,15 @@ | |
| 87 87 | 
             
                        ],
         | 
| 88 88 | 
             
                        "default": {}
         | 
| 89 89 | 
             
                    },
         | 
| 90 | 
            -
                    "maxItems": { "$ref": "#/definitions/ | 
| 91 | 
            -
                    "minItems": { "$ref": "#/definitions/ | 
| 90 | 
            +
                    "maxItems": { "$ref": "#/definitions/nonNegativeInteger" },
         | 
| 91 | 
            +
                    "minItems": { "$ref": "#/definitions/nonNegativeIntegerDefault0" },
         | 
| 92 92 | 
             
                    "uniqueItems": {
         | 
| 93 93 | 
             
                        "type": "boolean",
         | 
| 94 94 | 
             
                        "default": false
         | 
| 95 95 | 
             
                    },
         | 
| 96 96 | 
             
                    "contains": { "$ref": "#" },
         | 
| 97 | 
            -
                    "maxProperties": { "$ref": "#/definitions/ | 
| 98 | 
            -
                    "minProperties": { "$ref": "#/definitions/ | 
| 97 | 
            +
                    "maxProperties": { "$ref": "#/definitions/nonNegativeInteger" },
         | 
| 98 | 
            +
                    "minProperties": { "$ref": "#/definitions/nonNegativeIntegerDefault0" },
         | 
| 99 99 | 
             
                    "required": { "$ref": "#/definitions/stringArray" },
         | 
| 100 100 | 
             
                    "additionalProperties": { "$ref": "#" },
         | 
| 101 101 | 
             
                    "definitions": {
         | 
    
        metadata
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: json-schema
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version:  | 
| 4 | 
            +
              version: 4.1.1
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Kenny Hoxworth
         | 
| @@ -9,10 +9,10 @@ authors: | |
| 9 9 | 
             
            autorequire: 
         | 
| 10 10 | 
             
            bindir: bin
         | 
| 11 11 | 
             
            cert_chain: []
         | 
| 12 | 
            -
            date:  | 
| 12 | 
            +
            date: 2023-09-15 00:00:00.000000000 Z
         | 
| 13 13 | 
             
            dependencies:
         | 
| 14 14 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 15 | 
            -
              name:  | 
| 15 | 
            +
              name: bundler
         | 
| 16 16 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 17 17 | 
             
                requirements:
         | 
| 18 18 | 
             
                - - ">="
         | 
| @@ -40,7 +40,7 @@ dependencies: | |
| 40 40 | 
             
                  - !ruby/object:Gem::Version
         | 
| 41 41 | 
             
                    version: '5.0'
         | 
| 42 42 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 43 | 
            -
              name:  | 
| 43 | 
            +
              name: rake
         | 
| 44 44 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 45 45 | 
             
                requirements:
         | 
| 46 46 | 
             
                - - ">="
         | 
| @@ -54,7 +54,7 @@ dependencies: | |
| 54 54 | 
             
                  - !ruby/object:Gem::Version
         | 
| 55 55 | 
             
                    version: '0'
         | 
| 56 56 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 57 | 
            -
              name:  | 
| 57 | 
            +
              name: webmock
         | 
| 58 58 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 59 59 | 
             
                requirements:
         | 
| 60 60 | 
             
                - - ">="
         | 
| @@ -137,6 +137,7 @@ files: | |
| 137 137 | 
             
            - lib/json-schema/attributes/properties.rb
         | 
| 138 138 | 
             
            - lib/json-schema/attributes/properties_optional.rb
         | 
| 139 139 | 
             
            - lib/json-schema/attributes/properties_v4.rb
         | 
| 140 | 
            +
            - lib/json-schema/attributes/propertynames.rb
         | 
| 140 141 | 
             
            - lib/json-schema/attributes/ref.rb
         | 
| 141 142 | 
             
            - lib/json-schema/attributes/required.rb
         | 
| 142 143 | 
             
            - lib/json-schema/attributes/type.rb
         | 
| @@ -190,7 +191,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement | |
| 190 191 | 
             
                - !ruby/object:Gem::Version
         | 
| 191 192 | 
             
                  version: '2.5'
         | 
| 192 193 | 
             
            requirements: []
         | 
| 193 | 
            -
            rubygems_version: 3.3. | 
| 194 | 
            +
            rubygems_version: 3.3.26
         | 
| 194 195 | 
             
            signing_key: 
         | 
| 195 196 | 
             
            specification_version: 4
         | 
| 196 197 | 
             
            summary: Ruby JSON Schema Validator
         |