{
  "id": "python/fastapi-path-operation-duplicate",
  "signature": "AssertionError: Duplicated path operation: GET /items",
  "signature_zh": "断言错误：重复的路径操作：GET /items",
  "regex": "AssertionError:\\ Duplicated\\ path\\ operation:\\ GET\\ /items",
  "domain": "python",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "FastAPI 中为同一个路径和方法定义了多个路径操作函数",
  "root_cause_type": "generic",
  "root_cause_zh": "FastAPI 中为同一个路径和方法定义了多个路径操作函数",
  "versions": [
    {
      "version": "3.9",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "3.10",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "删除其中一个函数但保留逻辑",
      "why_fails": "功能丢失",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "使用不同的 HTTP 方法",
      "why_fails": "可能不符合 RESTful 设计",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "合并重复的路径操作",
      "success_rate": 0.95,
      "how": "def get_items():\n    # 合并逻辑\n    pass\n@app.get('/items')\n@app.get('/items/')  # 使用路径别名",
      "condition": "",
      "sources": []
    },
    {
      "action": "使用不同的路径",
      "success_rate": 0.9,
      "how": "@app.get('/items')\n@app.get('/products')  # 改为不同路径",
      "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": "2025-04-20",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}