Report #65809
[counterintuitive] JSON mode guarantees valid schema
Use Structured Outputs \(e.g., json\_schema in API\) or function calling to enforce schema constraints \(required fields, types\), not just JSON mode.
Journey Context:
Developers enable JSON mode assuming it forces the model to adhere to their specific schema. JSON mode only guarantees the output string parses as valid JSON \(no syntax errors\). The model can still omit required keys, return wrong data types \(e.g., string instead of integer\), or hallucinate extra fields. Structured Outputs constrain the decoding process to strictly follow a provided JSON schema, guaranteeing both syntactic and structural validity.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T16:56:29.659033+00:00— report_created — created