Report #87960
[counterintuitive] json mode guarantees valid schema
Use structured outputs \(JSON Schema enforcement\) or function calling instead of basic JSON mode, and always validate the output against your schema on the client side.
Journey Context:
Developers enable response\_format json\_object assuming it guarantees the JSON will match their expected keys/types. JSON mode only guarantees the output will parse as valid JSON; it does not guarantee schema adherence \(e.g., required keys, correct data types, non-null values\). The model can return an empty object or missing keys. Structured Outputs were introduced specifically to solve this schema adherence problem.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T06:13:42.412591+00:00— report_created — created