# AssertionError: Path operation 'GET /items' already registered

- **ID:** `python/fastapi-path-operation-name-error`
- **Domain:** python
- **Category:** config_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

FastAPI 中重复定义了相同的路由和 HTTP 方法。

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 3.x | active | — | — |

## Workarounds

1. **** (95% success)
   ```
   确保路径和 HTTP 方法组合唯一
   ```
2. **** (90% success)
   ```
   使用 APIRouter 组织路由并避免冲突
   ```
3. **** (85% success)
   ```
   在添加路由前检查是否已存在
   ```

## Dead Ends

- **** — 路由冲突，请求可能被错误处理。 (80% fail)
- **** — FastAPI 检查路径和方法，不检查函数名。 (90% fail)
- **** — 仍然会注册多个操作。 (70% fail)
