Sha256: e33273d382c9e64cf8b060a14efbfaaea61d9063204eb5009e172ac43f2fbc4f

Contents?: true

Size: 1.65 KB

Versions: 11

Compression:

Stored size: 1.65 KB

Contents

require 'json-schema/schema/validator'

module JSON
  class Schema

    class Draft2 < Validator
      def initialize
        super
        @attributes = {
          "type" => JSON::Schema::TypeAttribute,
          "disallow" => JSON::Schema::DisallowAttribute,
          "format" => JSON::Schema::FormatAttribute,
          "maximum" => JSON::Schema::MaximumInclusiveAttribute,
          "minimum" => JSON::Schema::MinimumInclusiveAttribute,
          "minItems" => JSON::Schema::MinItemsAttribute,
          "maxItems" => JSON::Schema::MaxItemsAttribute,
          "uniqueItems" => JSON::Schema::UniqueItemsAttribute,
          "minLength" => JSON::Schema::MinLengthAttribute,
          "maxLength" => JSON::Schema::MaxLengthAttribute,
          "divisibleBy" => JSON::Schema::DivisibleByAttribute,
          "enum" => JSON::Schema::EnumAttribute,
          "properties" => JSON::Schema::PropertiesOptionalAttribute,
          "pattern" => JSON::Schema::PatternAttribute,
          "additionalProperties" => JSON::Schema::AdditionalPropertiesAttribute,
          "items" => JSON::Schema::ItemsAttribute,
          "extends" => JSON::Schema::ExtendsAttribute
        }
        @default_formats = {
          'date-time' => DateTimeFormat,
          'date' => DateFormat,
          'time' => TimeFormat,
          'ip-address' => IP4Format,
          'ipv6' => IP6Format,
          'uri' => UriFormat
        }
        @formats = @default_formats.clone
        @uri = JSON::Util::URI.parse("http://json-schema.org/draft-02/schema#")
        @names = ["draft2"]
        @metaschema_name = "draft-02.json"
      end

      JSON::Validator.register_validator(self.new)
    end

  end
end

Version data entries

11 entries across 10 versions & 3 rubygems

Version Path
json-schema-ouidou-2.9.1 lib/json-schema/validators/draft2.rb
json-schema-ouidou-2.9.0 lib/json-schema/validators/draft2.rb
json-schema-3.0.0 lib/json-schema/validators/draft2.rb
mountapi-0.11.1 vendor/json-schema/lib/json-schema/validators/draft2.rb
mountapi-0.11.1 vendor/bundle/ruby/2.7.0/bundler/gems/json-schema-2253a5ee6679/lib/json-schema/validators/draft2.rb
json-schema-2.8.1 lib/json-schema/validators/draft2.rb
json-schema-2.8.0 lib/json-schema/validators/draft2.rb
json-schema-2.7.0 lib/json-schema/validators/draft2.rb
json-schema-2.6.2 lib/json-schema/validators/draft2.rb
json-schema-2.6.1 lib/json-schema/validators/draft2.rb
json-schema-2.6.0 lib/json-schema/validators/draft2.rb