ConduitMcp.Client.SchemaValidator.JSV (ConduitMCP v0.11.0)

Copy Markdown View Source

The default ConduitMcp.Client.SchemaValidator, built on JSV (JSON Schema 2020-12 and draft 7).

Only compiled when the optional {:jsv, "~> 0.26"} dependency is present; ConduitMcp.OptionalDeps.jsv!/0 checks for it when a client's options ask for validation.

Server schemas are untrusted, so they are built with JSV's default resolvers only (embedded meta-schemas and the schema's own documents: never the network), with no atom-creating casts, with build warnings silenced, and with JSV's jsv-cast / x-jsv-cast extension keywords removed; data is validated with casting off. JSV runs pattern and patternProperties under a backtracking budget linear in the subject size, so a catastrophic pattern such as (a+)+$ fails the value instead of hanging the caller. Schemas reach build/2 only after ConduitMcp.Client.SchemaValidator.check_bounds/1.