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



32
33
34
# File 'lib/json-schema/validator.rb', line 32

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

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



29
30
# File 'lib/json-schema/validator.rb', line 29

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

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



36
37
38
39
40
41
42
43
# File 'lib/json-schema/validator.rb', line 36

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