Class: JSON::Schema::Draft1

Inherits:
Validator show all
Defined in:
lib/json-schema/validators/draft1.rb

Instance Attribute Summary

Attributes inherited from Validator

#attributes, #uri

Instance Method Summary collapse

Methods inherited from Validator

#extend_schema_definition, #to_s, #validate

Constructor Details

#initializeDraft1

Returns a new instance of Draft1.



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/json-schema/validators/draft1.rb', line 5

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,
    "minLength" => JSON::Schema::MinLengthAttribute,
    "maxLength" => JSON::Schema::MaxLengthAttribute,
    "maxDecimal" => JSON::Schema::MaxDecimalAttribute,
    "enum" => JSON::Schema::EnumAttribute,
    "properties" => JSON::Schema::PropertiesOptionalAttribute,
    "pattern" => JSON::Schema::PatternAttribute,
    "additionalProperties" => JSON::Schema::AdditionalPropertiesAttribute,
    "items" => JSON::Schema::ItemsAttribute,
    "extends" => JSON::Schema::ExtendsAttribute
  }
  @uri = URI.parse("http://json-schema.org/draft-01/schema#")
end