Catch structured-output failures before production
OpenAI’s strict structured outputs enforce a precise contract: every property
must be declared, all of them must be in required, and additionalProperties
must be false. A response that looks fine to the eye can still fail validation
because of one undeclared field or one missing required key. This tool compares
your schema against a sample response and reports every mismatch with its exact
path.
How it works
Paste your JSON Schema and a sample response object. The tool parses both, then
walks the schema recursively against the data. At each level it checks the
declared type, confirms every required field is present, recurses into nested
objects and array items, and — when additionalProperties is false — flags
any property in the data that the schema does not declare. Each problem is
reported with a dotted path like data.address.zip so you can pinpoint it
instantly.
The four failure modes it catches
Structured output validation fails in predictable ways. The conformance report flags each of these specifically:
- Missing required field — the schema declares a field as required but the
model response omits it entirely. Common with optional-looking fields (e.g.
"middle_name") that you forgot to either remove fromrequiredor guarantee in the prompt. - Type mismatch — the schema says
"type": "integer"but the model returned"3"(a string). Strict mode rejects this even though the value looks numeric. - Undeclared property — the model added a field (
"confidence": 0.9) that exists in the response but is not in the schema’sproperties. WithadditionalProperties: false, this causes a hard rejection. - Nested object violations — the three problems above can occur at any depth.
A path like
result.address.zipin the report tells you the violation is three levels deep.
Worked example
Suppose your schema requires a user object with name (string) and age
(integer), and the model returns:
{ "user": { "name": "Alice", "age": "30", "nickname": "Ali" } }
The report would show two problems: user.age has a type mismatch (expected
integer, got string) and user.nickname is an undeclared property. Fix the
prompt to force a numeric age and remove any instruction that suggests a nickname,
then re-run the test until the report shows zero violations.
Tips for strict-mode schemas
- Set
"additionalProperties": falseon every nested object, not just the root. A missing flag deep in a nested schema is a common source of failures that look unexplained. - Keep
"required"listing every property. In strict mode, omitting a field fromrequiredis not the same as making it optional — OpenAI’s strict mode requires all declared properties to be listed there. - If the model keeps hallucinating extra fields, name the undesired fields in your prompt and explicitly say not to include them, rather than leaving the schema to handle it alone.
- Use this tool iteratively — fix one path, re-run with a fresh sample, and repeat
until the report is empty before wiring the schema into your production
response_format.