Skip to main content
The Schema Verifier goes beyond standard JSON validation. It combines Pydantic structure enforcement with Symbolic Math checks deeply embedded within the schema.

How it works

It validates that:
  1. Structure: The output matches the required JSON keys and types.
  2. Logic: The numeric values inside the JSON are mathematically consistent (e.g., total == sum(items)).

Usage

Object validation

The Schema Verifier supports standard JSON Schema object keywords including properties, required, and additionalProperties.

additionalProperties: false — strict fail-closed validation

When a schema sets "additionalProperties": false and the verifier runs with strict=True (the default), any property that is not declared in properties causes the payload to fail validation. The verifier records each undeclared property as an ERROR-severity additional_property issue, so is_valid is false and status is INVALID. In non-strict mode (strict=False), additionalProperties: false is treated as advisory and undeclared properties do not block validation. Issue types returned for additionalProperties: Example — strict mode rejects extra fields:
Example — declared-only payloads pass:
Example — nested objects also fail closed:
This fail-closed behavior for strict additionalProperties: false was hardened in the v5.1.x line. See the changelog for the release notes.

Array validation

The Schema Verifier supports standard JSON Schema array keywords including uniqueItems.

uniqueItems — fail-closed validation

When a schema sets uniqueItems: true, the verifier checks that every element in the array is distinct. If an element is unhashable or otherwise cannot be compared deterministically (for example, an object containing a Python set), the verifier fails closed — it reports a uniqueness_validation_error issue instead of silently passing. This ensures that unverifiable arrays are never treated as valid. Issue types returned for uniqueItems: Example — duplicate items:
Example — uncheckable items fail closed:
This fail-closed behavior shipped in v5.1.0. See the changelog for the full release notes.

Object validation

Strict mode and additionalProperties: false

When a schema sets additionalProperties: false and you call the verifier with strict=True, undeclared properties on the payload now cause verification to fail closed. The verifier emits an additional_property issue with severity ERROR, and the overall result is INVALID. Previously, undeclared properties in strict mode were recorded with severity WARNING. Because validity was determined only by ERROR-level issues, payloads with forbidden extra fields could still return VALID. A strict schema denial is a structural validation failure, not an advisory warning, so strict mode now rejects these payloads outright. This applies at every level of the schema — extra properties on nested objects that set additionalProperties: false are also rejected. Behavior matrix: Example — strict mode rejects extra fields:
Example — nested objects also fail closed:
This fail-closed behavior is enabled only when strict=True. With strict=False, extra properties remain non-blocking and the payload is still treated as valid, preserving permissive workflows.

When to use

  • Invoice Processing: Ensure line items sum to the total.
  • Financial Reports: Ensure balance sheets balance.
  • Tax Forms: Ensure calculated fields match underlying data.
  • Strict API contracts: Reject payloads with undeclared fields when strict=True and additionalProperties: false are combined.