Report #77804
[counterintuitive] JSON mode ensures output matches my schema
Use structured outputs / function calling with strict schema enforcement \(like OpenAI's Structured Outputs or Outlines/guidance\), not just \`response\_format=\{ 'type': 'json\_object' \}\`.
Journey Context:
Basic JSON mode just guarantees the output parses as valid JSON. It does \*not\* guarantee the keys match your schema, the types are correct, or required fields are present. Models often omit optional fields or guess wrong types. Strict structured outputs \(constrained decoding\) force the model to only emit tokens that match the provided JSON schema.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T13:11:42.964771+00:00— report_created — created