{
  "id": "python/fastapi-path-param-type-error",
  "signature": "fastapi.exceptions.RequestValidationError: [{'loc': ['path', 'item_id'], 'msg': 'value is not a valid integer', 'type': 'type_error.integer'}]",
  "signature_zh": "FastAPI 请求验证错误：路径参数 'item_id' 不是有效的整数",
  "regex": "fastapi\\.exceptions\\.RequestValidationError:\\ \\[\\{'loc':\\ \\['path',\\ 'item_id'\\],\\ 'msg':\\ 'value\\ is\\ not\\ a\\ valid\\ integer',\\ 'type':\\ 'type_error\\.integer'\\}\\]",
  "domain": "python",
  "category": "data_error",
  "subcategory": null,
  "root_cause": "A path parameter annotated as int receives a non-integer value from the URL.",
  "root_cause_type": "generic",
  "root_cause_zh": "路径参数标注为 int，但 URL 中提供了非整数值。",
  "versions": [
    {
      "version": "3.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "This doesn't fix the client's request; they still need to send a valid integer.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Loses automatic validation; you have to handle conversion errors yourself.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.9,
      "how": "Ensure the client sends an integer in the URL, e.g., /items/123",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 1.0,
      "how": "Use a Pydantic model or path converter: @app.get('/items/{item_id}') with item_id: int",
      "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-18",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}