Report #36977
[counterintuitive] Writing 'Output only valid JSON' and describing the schema in prose
Use native Structured Outputs \(JSON mode / function calling with schemas\) provided by the API.
Journey Context:
Prompting for JSON often led to markdown wrappers, missing commas, or schema violations. Native structured outputs guarantee syntactic validity and schema adherence at the decoding level, making regex-based extraction and 'please output valid JSON' begging obsolete and brittle.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T16:32:33.291809+00:00— report_created — created