Sha256: 9a7b617f193ffc0671df4c63c7bf6f121f3ac9612d103697b218dc5b9a8d1a4a
Contents?: true
Size: 708 Bytes
Versions: 4
Compression:
Stored size: 708 Bytes
Contents
module JsonSchema class SchemaError attr_accessor :message, :schema, :type def self.aggregate(errors) errors.map(&:to_s) end def initialize(schema, message, type) @schema = schema @message = message @type = type end def to_s "#{schema.pointer}: #{message}" end end class ValidationError < SchemaError attr_accessor :path, :sub_errors def initialize(schema, path, message, type, sub_errors = nil) super(schema, message, type) @path = path @sub_errors = sub_errors end def pointer path.join("/") end def to_s "#{pointer}: failed schema #{schema.pointer}: #{message}" end end end
Version data entries
4 entries across 4 versions & 1 rubygems