{
  "id": "python/starlette-request-json-decode-error",
  "signature": "ValueError: Expecting property name enclosed in double quotes: line 1 column 2 (char 1)",
  "signature_zh": "值错误：期望属性名用双引号括起来：第1行第2列（字符1）",
  "regex": "ValueError:\\ Expecting\\ property\\ name\\ enclosed\\ in\\ double\\ quotes:\\ line\\ 1\\ column\\ 2\\ \\(char\\ 1\\)",
  "domain": "python",
  "category": "data_error",
  "subcategory": null,
  "root_cause": "请求体JSON格式错误，例如使用单引号而不是双引号",
  "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": "尝试在服务器端修复JSON格式",
      "why_fails": "服务器端无法修改请求体内容",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    },
    {
      "action": "使用eval解析JSON",
      "why_fails": "eval不安全且不适用于所有JSON变体",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "确保客户端发送有效JSON",
      "success_rate": 0.95,
      "how": "{\"name\": \"John\"}",
      "condition": "",
      "sources": []
    },
    {
      "action": "在服务器端使用宽松解析",
      "success_rate": 0.8,
      "how": "import json\nbody = await request.body()\ntry:\n    data = json.loads(body)\nexcept ValueError:\n    data = eval(body)  # 不推荐",
      "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.83,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-10-10",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}