{
  "id": "python/fastapi-route-duplicate-path",
  "signature": "AssertionError: Duplicate path parameter: 'item_id'",
  "signature_zh": "断言错误：重复的路径参数：'item_id'",
  "regex": "AssertionError:\\ Duplicate\\ path\\ parameter:\\ 'item_id'",
  "domain": "python",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "FastAPI路由中定义了相同名称的路径参数，导致参数冲突",
  "root_cause_type": "generic",
  "root_cause_zh": "FastAPI路由中定义了相同名称的路径参数，导致参数冲突",
  "versions": [
    {
      "version": "3.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "尝试更改路由顺序而不修改参数名",
      "why_fails": "参数名重复是根本问题，顺序无关",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    },
    {
      "action": "使用不同的HTTP方法但保留相同参数名",
      "why_fails": "参数名冲突发生在同一路由组内",
      "fail_rate": 0.3,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "重命名其中一个路径参数",
      "success_rate": 0.95,
      "how": "@app.get('/items/{item_id}')\n@app.get('/items/{other_id}')",
      "condition": "",
      "sources": []
    },
    {
      "action": "合并为单个路由并处理不同逻辑",
      "success_rate": 0.9,
      "how": "@app.get('/items/{item_id}')\nasync def read_item(item_id: int): pass",
      "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.82,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-03-20",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}