Report #49848
[counterintuitive] Does JSON mode guarantee logically valid or correct schema output
Use strict Structured Outputs \(like OpenAI's function calling or Pydantic schema enforcement\) rather than basic JSON mode, and always validate the semantic content in application code.
Journey Context:
Developers enable \`response\_format=\{ 'type': 'json\_object' \}\` and assume the output will perfectly match their expected schema. Basic JSON mode only guarantees the string parses as valid JSON \(brackets match, quotes close\). It does NOT guarantee the JSON matches your specific schema, contains required keys, or has valid enum values. Models frequently output structurally valid but semantically empty JSON \(e.g., \`\{'error': 'I do not know'\}\`\). This gap led providers to introduce strict Structured Outputs.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T14:09:22.372029+00:00— report_created — created