Class: JSON::Schema::Attribute

Inherits:
Object
  • Object
show all
Defined in:
lib/json-schema/validator.rb

Class Method Summary collapse

Class Method Details

.build_fragment(fragments) ⇒ Object



52
53
54
# File 'lib/json-schema/validator.rb', line 52

def self.build_fragment(fragments)
  "#/#{fragments.join('/')}"
end

.validate(current_schema, data, fragments, validator, options = {}) ⇒ Object



49
50
# File 'lib/json-schema/validator.rb', line 49

def self.validate(current_schema, data, fragments, validator, options = {})
end

.validation_error(message, fragments, current_schema, failed_attribute, record_errors) ⇒ Object



56
57
58
59
60
61
62
63
# File 'lib/json-schema/validator.rb', line 56

def self.validation_error(message, fragments, current_schema, failed_attribute, record_errors)
  error = ValidationError.new(message, fragments, failed_attribute, current_schema)
  if record_errors
    ::JSON::Validator.validation_error(error)
  else
    raise error
  end
end

.validation_errorsObject



65
66
67
# File 'lib/json-schema/validator.rb', line 65

def self.validation_errors
  ::JSON::Validator.validation_errors
end