Skip to content
cosmodev ~/tools/strict-output-validator

Strict Output Validator

AI & Agents

Check a JSON Schema against OpenAI structured-outputs strict mode rules — open objects, missing required keys, unsupported keywords — before the API rejects it. 100% client-side.

Try:

What it does

The Strict Output Validator checks a JSON Schema against the rules OpenAI’s structured-outputs strict mode enforces — so the schema fails here, with a readable list of reasons, instead of at the API with a 400. It verifies the four structural rules strict mode is known for (closed objects, all-properties-required, required-matches-properties, object root) plus a conservative allowlist of supported types and keywords, walking nested objects, arrays, anyOf, allOf, and $defs. Runs 100% client-side; your schema never leaves the browser.

How to use it

  1. Paste your JSON Schema into the left panel (or pick a sample chip to see each failure class).
  2. Read the verdict: green means strict-conformant; red lists every issue with its JSON path and rule id (missing-additional-properties, property-not-required, …).
  3. Fix the issues top-down — path order follows the schema document.
  4. Use Copy on the schema or the schema link to share an exact repro.

Examples

This schema fails with two issues:

{
  "type": "object",
  "properties": {
    "name": { "type": "string", "minLength": 2 },
    "tags": { "type": "array", "items": { "type": "string" } }
  },
  "required": ["name"],
  "additionalProperties": false
}
  • $.properties.name · unsupported-keyword — minLength is not supported in strict mode.
  • $.required · property-not-required — tags is defined but not required.

The strict-conformant version:

{
  "type": "object",
  "properties": {
    "name": { "type": "string" },
    "tags": { "type": "array", "items": { "type": "string" } }
  },
  "required": ["name", "tags"],
  "additionalProperties": false
}

Good to know

  • The four structural rules, in plain words: the root must be an object; every object must say additionalProperties: false; every property in properties must appear in required; every required name must have a definition.
  • Nullable fields use the type-array form: "type": ["string", "null"]. A bare "type": "null" is rejected.
  • Unions are anyOf; oneOf is not supported, and allOf only as a single-element wrapper.
  • The keyword allowlist mirrors OpenAI’s documented subset and is conservative — if a keyword is flagged that your provider accepts, keep the schema; treat the verdict as advisory for that provider.
  • Runs 100% client-side. Nothing you paste is sent anywhere.
  • Related: JSON to Zod, JSON Validator, JSON Repair.
Source code14 languages

100% client-side · your data never leaves your browser. Found this useful? Share it with a teammate.