Report #61344
[counterintuitive] Does LLM JSON mode ensure output matches my specific schema
Use structured outputs \(e.g., OpenAI Structured Outputs or constrained decoding\) instead of basic JSON mode, and always validate with a JSON schema validator on the application side.
Journey Context:
Developers enable JSON mode and assume the output will match their desired schema \(e.g., have specific keys, correct types\). JSON mode only guarantees the output is parsable JSON \(valid syntax\), not that it conforms to any specific schema. It will often omit required fields or hallucinate extra keys. Structured outputs are required for schema enforcement.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T09:27:01.873175+00:00— report_created — created