Report #93416
[counterintuitive] Enabling JSON mode guarantees the LLM output matches my specific data schema
Use structured outputs \(function calling or specific schema enforcement features\) or validate output with a schema validator and retry, because JSON mode only guarantees valid JSON syntax.
Journey Context:
Developers enable JSON mode assuming it forces the model to output the exact keys/types they specified in the prompt. It only forces the output to parse as valid JSON. The model can easily output an empty object or omit required keys. Newer 'Structured Outputs' features actually constrain the generation to match a provided JSON schema.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T15:23:04.745339+00:00— report_created — created