{
  "id": "python/django-json-parse-error",
  "signature": "json.JSONDecodeError: Expecting value: line 1 column 1 (char 0)",
  "signature_zh": "JSON 解码错误：期望值：第 1 行第 1 列（字符 0）",
  "regex": "json\\.JSONDecodeError:\\ Expecting\\ value:\\ line\\ 1\\ column\\ 1\\ \\(char\\ 0\\)",
  "domain": "python",
  "category": "data_error",
  "subcategory": null,
  "root_cause": "Request body is empty or not valid JSON when trying to parse.",
  "root_cause_type": "generic",
  "root_cause_zh": "请求体为空或不是有效的 JSON，尝试解析时出错。",
  "versions": [
    {
      "version": "3.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Using json.loads(request.body) without checking content type can raise error.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Catching JSONDecodeError with broad except hides the real issue.",
      "fail_rate": 0.4,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "Check request.body is not empty and content-type is application/json before parsing.",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.9,
      "how": "Use try-except: try: data = json.loads(request.body) except json.JSONDecodeError: return HttpResponseBadRequest('Invalid JSON')",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": null,
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.87,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2025-04-11",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}