adk_json_schema (erlang_adk v0.7.0)
View SourceDeterministic validation for the provider-neutral JSON Schema subset used by agent input and output contracts.
Values are normalized through adk_json before validation. Errors contain a structural path and constraint name, never the rejected value.
Summary
Types
Functions
-spec compile(undefined | boolean() | map()) -> {ok, schema()} | {error, error_reason()}.
-spec validate(schema(), term()) -> {ok, term()} | {error, error_reason()}.
Validate and return the canonical JSON representation of a value.
-spec validate_compiled(schema(), term()) -> {ok, term()} | {error, error_reason()}.
Validate a value against a schema already returned by compile/1.
This is deliberately a separate trust boundary: callers must not pass an arbitrary schema. Catalogs can compile immutable contracts once and avoid recursively checking the schema again for every model-generated value.