{
  "id": "python/fastapi-request-body-malformed-json",
  "signature": "json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)",
  "signature_zh": "JSON 解码错误：期望值：第 1 行第 1 列（字符 0）",
  "regex": "json\\.decoder\\.JSONDecodeError:\\ Expecting\\ value:\\ line\\ 1\\ column\\ 1\\ \\(char\\ 0\\)",
  "domain": "python",
  "category": "data_error",
  "subcategory": null,
  "root_cause": "客户端发送的请求体不是有效的 JSON，或者 Content-Type 不是 application/json。",
  "root_cause_type": "generic",
  "root_cause_zh": "客户端发送的请求体不是有效的 JSON，或者 Content-Type 不是 application/json。",
  "versions": [
    {
      "version": "3.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "FastAPI 可能仍然尝试解析 JSON，导致错误。",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "原始数据可能不是 JSON，解析仍会失败。",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.9,
      "how": "from pydantic import BaseModel\nclass Item(BaseModel):\n    name: str\n@app.post('/items')\nasync def create(item: Item):\n    return item",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.95,
      "how": "import requests\nrequests.post(url, json={'name': 'test'})",
      "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.89,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-12-10",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}