Report #41365
[counterintuitive] JSON mode guarantees valid data schemas
Use Structured Outputs \(function calling or specific schema enforcement features\) rather than basic JSON mode to guarantee schema compliance, not just syntax validity.
Journey Context:
Developers enable 'JSON mode' assuming it forces the model to output data matching their expected keys and types. JSON mode only guarantees the output is valid JSON \(parsable, correct brackets/quotes\). It does not guarantee the presence of required keys, correct data types, or adherence to a specific schema. Models frequently omit keys or hallucinate extra ones under basic JSON mode. Structured outputs \(constrained decoding\) are required for strict schema adherence.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T23:54:14.536220+00:00— report_created — created