{
  "id": "python/fastapi-duplicate-route",
  "signature": "AssertionError: Duplicate route: /items",
  "signature_zh": "断言错误：重复的路由：/items",
  "regex": "AssertionError:\\ Duplicate\\ route:\\ /items",
  "domain": "python",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "FastAPI does not allow defining two route handlers for the same HTTP method and path.",
  "root_cause_type": "generic",
  "root_cause_zh": "FastAPI 不允许为同一 HTTP 方法和路径定义两个路由处理程序。",
  "versions": [
    {
      "version": "3.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Renaming one function without changing the route",
      "why_fails": "The route path and method are still duplicated.",
      "fail_rate": 1.0,
      "condition": "",
      "sources": []
    },
    {
      "action": "Adding a prefix to one route manually",
      "why_fails": "If the prefix doesn't change the full path, duplication persists.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Remove or comment out the duplicate route",
      "success_rate": 1.0,
      "how": "# Remove the second @app.get('/items') decorator",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use different HTTP methods or paths",
      "success_rate": 1.0,
      "how": "@app.get('/items')\ndef list_items(): ...\n@app.post('/items')\ndef create_item(): ...",
      "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.85,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-04-20",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}