Backplane.McpProtocol.SchemaValidator behaviour (backplane_mcp_protocol v0.6.0)

Copy Markdown

Adapter boundary between JSON Schema wire documents and local validation.

Wire schemas are always retained independently of whether an adapter can validate them. Adapters must decline unsupported vocabulary explicitly rather than applying a lossy interpretation.

Summary

Types

compiled()

@type compiled() :: term()

reason()

@type reason() :: term()

Callbacks

compile(map, keyword)

@callback compile(
  map(),
  keyword()
) :: {:ok, compiled()} | {:unsupported, reason()} | {:error, reason()}

validate(compiled, term, keyword)

@callback validate(compiled(), term(), keyword()) :: :ok | {:error, reason()}