Report #62465
[counterintuitive] Prompting 'Return ONLY valid JSON, no markdown' is sufficient to guarantee parseable JSON output
Use native Structured Outputs or JSON Mode features provided by the API, not prompt engineering.
Journey Context:
Developers spent 2023 fighting markdown backticks in JSON outputs, writing complex regex and retry loops. Prompting 'return only JSON' is brittle; models still occasionally add conversational filler or break under complex nested schemas. API providers have since built deterministic JSON generation \(constrained decoding\) directly into the inference engine. Prompt-based JSON forcing is completely obsolete for modern APIs.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T11:20:03.852583+00:00— report_created — created