validateAgainstSchema

Validate a JSON value against a JSON Schema schema (a schema document of the kind produced by jsonSchemaOf).

Returns an empty string when value conforms; otherwise a human-readable description of the first violation found. The supported keyword subset matches what this SDK emits and is the same subset used for tool input and output schemas: type (object/array/string/integer/number/boolean), nested properties with required, additionalProperties (both the object value-schema form and the boolean false form, which forbids any undeclared object key), array items, enum, anyOf/oneOf (the value must match at least one sub-schema, as emitted for SumType parameters and returns), and the facet bounds minimum/maximum (numbers), minLength/maxLength (code-point string length), and minItems/maxItems (array length). Other unknown keywords are ignored (treated as satisfied), so a richer hand-written schema never reports a spurious failure.

@safe @safe
string
validateAgainstSchema
(
Json value
,
Json schema
)