Class: JSON::Schema::Attribute
- Inherits:
-
Object
- Object
- JSON::Schema::Attribute
show all
- Defined in:
- lib/json-schema/validator.rb
Direct Known Subclasses
AdditionalItemsAttribute, AdditionalPropertiesAttribute, AllOfAttribute, AnyOfAttribute, DependenciesAttribute, DependenciesV4Attribute, DisallowAttribute, DivisibleByAttribute, EnumAttribute, ExtendsAttribute, FormatAttribute, ItemsAttribute, MaxDecimalAttribute, MaxItemsAttribute, MaxLengthAttribute, MaxPropertiesAttribute, MaximumAttribute, MaximumInclusiveAttribute, MinItemsAttribute, MinLengthAttribute, MinPropertiesAttribute, MinimumAttribute, MinimumInclusiveAttribute, MultipleOfAttribute, NotAttribute, OneOfAttribute, PatternAttribute, PatternPropertiesAttribute, PropertiesAttribute, PropertiesOptionalAttribute, PropertiesV4Attribute, RefAttribute, RequiredAttribute, TypeAttribute, TypeV4Attribute, UniqueItemsAttribute
Class Method Summary
collapse
-
.build_fragment(fragments) ⇒ Object
-
.last_fragment_as_symbol(fragments) ⇒ Object
-
.validate(current_schema, data, fragments, processor, validator, options = {}) ⇒ Object
-
.validation_error(processor, message, fragments, current_schema, failed_attribute, record_errors, error_details = {}) ⇒ Object
-
.validation_errors(validator) ⇒ Object
Class Method Details
.build_fragment(fragments) ⇒ Object
55
56
57
|
# File 'lib/json-schema/validator.rb', line 55
def self.build_fragment(fragments)
"#/#{fragments.join('/')}"
end
|
.last_fragment_as_symbol(fragments) ⇒ Object
59
60
61
62
|
# File 'lib/json-schema/validator.rb', line 59
def self.last_fragment_as_symbol(fragments)
return nil if fragments.empty?
fragments.first.to_sym
end
|
.validate(current_schema, data, fragments, processor, validator, options = {}) ⇒ Object
52
53
|
# File 'lib/json-schema/validator.rb', line 52
def self.validate(current_schema, data, fragments, processor, validator, options = {})
end
|
.validation_error(processor, message, fragments, current_schema, failed_attribute, record_errors, error_details = {}) ⇒ Object
64
65
66
67
68
69
70
71
|
# File 'lib/json-schema/validator.rb', line 64
def self.validation_error(processor, message, fragments, current_schema, failed_attribute, record_errors, error_details={})
error = ValidationError.new(message, fragments, failed_attribute, current_schema, error_details)
if record_errors
processor.validation_error(error)
else
raise error
end
end
|
.validation_errors(validator) ⇒ Object
73
74
75
|
# File 'lib/json-schema/validator.rb', line 73
def self.validation_errors(validator)
validator.validation_errors
end
|