{
  "id": 12892053,
  "title": "Your LLM returned almost-valid JSON. Stop hand-patching it.",
  "url": "https://urgent.news/2026/10/08/your-llm-returned-almost-valid-json-stop-hand-patching-it",
  "topic": "ai",
  "section": "AI",
  "published": "2026-10-08T15:09:22.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/h1manshu01/your-llm-returned-almost-valid-json-stop-hand-patching-it-2fma"
  },
  "original_language": "en",
  "account": "The provided JSON from the LLM model contained several issues, including mismatched data types, missing fields, and incorrect formatting. For example, the \"id\" and \"active\" fields were strings instead of the expected number and boolean types, respectively. Additionally, the JSON was wrapped in a markdown code fence, which made parsing difficult. Furthermore, an extra \"role\" field was present that was not part of the requested schema.",
  "summary": "You asked the model for { id: number, active: boolean } . Here's what came back: { \"id\" : \"42\" , \"active\" : \"true\" , \"role\" : \"admin\" } Every field is almost right. id is a string. active is a string. There's a role you never asked for. And the whole thing is wrapped in a markdown code fence. So this: const user = User . parse ( JSON . parse ( raw )); // 💥 throws twice — once on the fence, and…",
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}