class JTD::ValidationError

Represents a single JSON Type Definition validation error.

ValidationError does not extend StandardError; it is not a Ruby exception. It is a plain old Ruby object.

Every ValidationError has two attributes:

Public Class Methods

from_hash(hash) click to toggle source

Constructs a new ValidationError from the standard JSON representation of a validation error in JSON Type Definition.

# File lib/jtd/validate.rb, line 100
def self.from_hash(hash)
  instance_path = hash['instancePath']
  schema_path = hash['schemaPath']

  ValidationError.new(instance_path, schema_path)
end