Bounded, value-free projection of a JSON Schema validation failure.
Validator errors may retain the rejected document, caller-authored property names, schema internals, and every rejected branch of a tagged union. This projection keeps only a closed rule atom and a path explained by the schema that rejected the document. Missing required properties may extend the validator's parent path only when the schema authorizes the missing name; unknown properties never retain their caller-authored key.
For a rejected oneOf, the branch with no discriminator failure and the
smallest bounded error set wins. This keeps a tagged installation's real
failure instead of reporting the unrelated required fields or closed keys of
every other installation variant.
Summary
Functions
Projects one JSV error list through the schema that rejected it.
Builds a bounded violation from an already schema-authorized path.
Validates one value, retries one timeout, and distinguishes unavailable bounded work.
Types
@type rule() ::
:const
| :contains
| :duplicate_property
| :enum
| :max_items
| :max_length
| :max_properties
| :maximum
| :min_items
| :min_length
| :min_properties
| :minimum
| :multiple_of
| :not
| :one_of
| :pattern
| :required
| :schema
| :type
| :unique_items
| :unknown_property
@type t() :: %PtcRunner.Kernel.SchemaViolation{ path: [PtcRunner.Kernel.CommandPath.segment()], rule: rule() }
Functions
Projects one JSV error list through the schema that rejected it.
@spec new(rule(), [PtcRunner.Kernel.CommandPath.segment()]) :: t()
Builds a bounded violation from an already schema-authorized path.
@spec validate(term(), map()) :: :ok | {:error, t()} | {:unavailable, unavailable_reason()}
Validates one value, retries one timeout, and distinguishes unavailable bounded work.