Spectre.Action.Schema (Spectre v0.3.4)

Copy Markdown View Source

Bounded JSON-Schema subset used at the action capability boundary.

Action providers historically used schema for discovery metadata such as arity and version. Those maps remain unconstrained. As soon as a schema declares a validation keyword, every constraint must belong to the supported vocabulary; unknown constraints fail closed instead of being ignored.

The validator deliberately returns paths and rule names, never rejected values, so telemetry and errors cannot accidentally disclose action payloads.

Summary

Functions

Returns whether a value declares at least one supported validation keyword.

Validates action arguments without evaluating code or resolving remote refs.

Types

path()

@type path() :: [String.t() | non_neg_integer()]

Functions

constrained?(schema)

@spec constrained?(term()) :: boolean()

Returns whether a value declares at least one supported validation keyword.

validate(schema, value)

@spec validate(term(), term()) :: :ok | {:error, term()}

Validates action arguments without evaluating code or resolving remote refs.