Class: JSON::Schema::Draft6

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

Direct Known Subclasses

HyperDraft6

Instance Attribute Summary

Attributes inherited from Validator

#attributes, #default_formats, #formats, #names, #uri

Instance Method Summary collapse

Methods inherited from Validator

#extend_schema_definition, #metaschema, #validate

Constructor Details

#initializeDraft6

Returns a new instance of Draft6.



6
7
8
9
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
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/json-schema/validators/draft6.rb', line 6

def initialize
  super
  @attributes = {
    'type' => JSON::Schema::TypeV4Attribute,
    'allOf' => JSON::Schema::AllOfAttribute,
    'anyOf' => JSON::Schema::AnyOfAttribute,
    'oneOf' => JSON::Schema::OneOfAttribute,
    'not' => JSON::Schema::NotAttribute,
    'disallow' => JSON::Schema::DisallowAttribute,
    'format' => JSON::Schema::FormatAttribute,
    'maximum' => JSON::Schema::MaximumAttribute,
    'minimum' => JSON::Schema::MinimumAttribute,
    'minItems' => JSON::Schema::MinItemsAttribute,
    'maxItems' => JSON::Schema::MaxItemsAttribute,
    'minProperties' => JSON::Schema::MinPropertiesAttribute,
    'maxProperties' => JSON::Schema::MaxPropertiesAttribute,
    'uniqueItems' => JSON::Schema::UniqueItemsAttribute,
    'minLength' => JSON::Schema::MinLengthAttribute,
    'maxLength' => JSON::Schema::MaxLengthAttribute,
    'multipleOf' => JSON::Schema::MultipleOfAttribute,
    'enum' => JSON::Schema::EnumAttribute,
    'properties' => JSON::Schema::PropertiesV4Attribute,
    'required' => JSON::Schema::RequiredAttribute,
    'pattern' => JSON::Schema::PatternAttribute,
    'patternProperties' => JSON::Schema::PatternPropertiesAttribute,
    'additionalProperties' => JSON::Schema::AdditionalPropertiesAttribute,
    'items' => JSON::Schema::ItemsAttribute,
    'additionalItems' => JSON::Schema::AdditionalItemsAttribute,
    'dependencies' => JSON::Schema::DependenciesV4Attribute,
    'extends' => JSON::Schema::ExtendsAttribute,
    'const' => JSON::Schema::ConstAttribute,
    '$ref' => JSON::Schema::RefAttribute,
    'propertyNames' => JSON::Schema::PropertyNames,
  }
  @default_formats = {
    'date-time' => DateTimeV4Format,
    'ipv4' => IP4Format,
    'ipv6' => IP6Format,
    'uri' => UriFormat,
  }
  @formats = @default_formats.clone
  @uri = JSON::Util::URI.parse('http://json-schema.org/draft-06/schema#')
  @names = ['draft6', 'http://json-schema.org/draft-06/schema#']
  @metaschema_name = 'draft-06.json'
end