{
  "id": "python/starlette-route-duplicate",
  "signature": "AssertionError: Path /items conflicts with existing route",
  "signature_zh": "断言错误：路径/items与现有路由冲突。",
  "regex": "AssertionError:\\ Path\\ /items\\ conflicts\\ with\\ existing\\ route",
  "domain": "python",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "在Starlette应用中定义了多个相同路径的路由，导致冲突。",
  "root_cause_type": "generic",
  "root_cause_zh": "在Starlette应用中定义了多个相同路径的路由，导致冲突。",
  "versions": [
    {
      "version": "3.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "尝试使用不同的方法（GET/POST）但路径相同，仍会冲突。",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "忽略冲突，但路由匹配可能意外。",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "合并路由或使用不同路径：\n@app.route(\"/items\")\nasync def list_items(request): ...\n@app.route(\"/items/{item_id}\")\nasync def get_item(request): ...",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.9,
      "how": "使用路由前缀：\napp = Starlette(routes=[\n    Route(\"/api/items\", endpoint=...),\n    Route(\"/api/items/{id}\", endpoint=...)\n])",
      "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-11-20",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}