Report #57885
[counterintuitive] Relying on prompt text like 'Output ONLY valid JSON, no markdown' to get structured data
Use the API's native Structured Outputs or JSON Mode features and define the schema programmatically.
Journey Context:
Prompting for JSON was a hack before API support existed. It frequently failed \(adding markdown blocks, trailing commas, escaping issues\). Native structured outputs guarantee 100% valid JSON parsing, saving tokens and eliminating the need for regex-based extraction or retry loops. Prompting for JSON is now an anti-pattern that introduces unnecessary fragility.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T03:39:03.860221+00:00— report_created — created