ExJsonschema.ValidationError exception (ExJsonschema v0.1.17)

View Source

Represents a JSON Schema validation error with detailed path and message information.

Summary

Functions

Creates a detailed ValidationError (backward compatibility). Only includes basic error information without verbose context.

Creates a ValidationError from a map returned by the NIF.

Returns a formatted error message for the exception.

Types

t()

@type t() :: %ExJsonschema.ValidationError{
  __exception__: true,
  annotations: map() | nil,
  context: map() | nil,
  instance_path: String.t(),
  instance_value: any() | nil,
  keyword: String.t() | nil,
  message: String.t(),
  schema_path: String.t(),
  schema_value: any() | nil,
  suggestions: [String.t()] | nil
}

Functions

from_detailed_map(map)

@spec from_detailed_map(map()) :: t()

Creates a detailed ValidationError (backward compatibility). Only includes basic error information without verbose context.

from_map(error_map)

@spec from_map(map()) :: t()

Creates a ValidationError from a map returned by the NIF.

Supports both detailed format (basic fields only) and verbose format (with additional context, values, and suggestions).

message(exception)

Returns a formatted error message for the exception.