{
  "id": "python/fastapi-valueerror-duplicate-route-path",
  "signature": "ValueError: Duplicate route path: /items",
  "signature_zh": "ValueError: 重复的路由路径：/items",
  "regex": "ValueError:\\ Duplicate\\ route\\ path:\\ /items",
  "domain": "python",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "Two route decorators define the same path without differentiating methods.",
  "root_cause_type": "generic",
  "root_cause_zh": "两个路由装饰器定义了相同的路径而没有区分方法。",
  "versions": [
    {
      "version": "3.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Removing one route entirely",
      "why_fails": "May lose needed functionality.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    },
    {
      "action": "Changing function name only",
      "why_fails": "Path remains duplicate.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Use different HTTP methods for same path",
      "success_rate": 0.95,
      "how": "@app.get('/items')\nasync def list_items(): pass\n@app.post('/items')\nasync def create_item(): pass",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use different paths",
      "success_rate": 0.9,
      "how": "@app.get('/items')\nasync def list_items(): pass\n@app.get('/items/{item_id}')\nasync def get_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.86,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-05-14",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}