Compile-once JSON Schema validation for FastestMCP.
Schemas default to JSON Schema Draft 2020-12. Draft 7 is also accepted when selected explicitly. Validation never coerces submitted values and remote references fail closed unless an application resolver is provided.
Summary
Functions
Compiles a JSON Schema into a reusable validator.
Compiles a JSON Schema, raising FastestMCP.Schema.Error on failure.
Returns a deterministic SHA-256 digest for a JSON Schema.
Returns whether the schema has the MCP-required object root.
Validates a value without coercion and returns the original value on success.
Types
Functions
@spec compile( raw(), keyword() ) :: {:ok, FastestMCP.Schema.Compiled.t()} | {:error, FastestMCP.Schema.Error.t()}
Compiles a JSON Schema into a reusable validator.
@spec compile!( raw(), keyword() ) :: FastestMCP.Schema.Compiled.t()
Compiles a JSON Schema, raising FastestMCP.Schema.Error on failure.
@spec digest(raw()) :: {:ok, String.t()} | {:error, FastestMCP.Schema.Error.t()}
Returns a deterministic SHA-256 digest for a JSON Schema.
Returns whether the schema has the MCP-required object root.
@spec validate(FastestMCP.Schema.Compiled.t(), term()) :: {:ok, term()} | {:error, FastestMCP.Schema.Error.t()}
Validates a value without coercion and returns the original value on success.