{
  "id": "python/fastapi-path-operation-name-error",
  "signature": "AssertionError: Path operation 'GET /items' already registered",
  "signature_zh": "断言错误：路径操作 'GET /items' 已经注册",
  "regex": "AssertionError:\\ Path\\ operation\\ 'GET\\ /items'\\ already\\ registered",
  "domain": "python",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "FastAPI 中重复定义了相同的路由和 HTTP 方法。",
  "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": "",
      "why_fails": "路由冲突，请求可能被错误处理。",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "FastAPI 检查路径和方法，不检查函数名。",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "仍然会注册多个操作。",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "确保路径和 HTTP 方法组合唯一",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.9,
      "how": "使用 APIRouter 组织路由并避免冲突",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.85,
      "how": "在添加路由前检查是否已存在",
      "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.88,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2026-01-10",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}