# AssertionError: Duplicated path operation: GET /items

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

## Root Cause

FastAPI 中为同一个路径和方法定义了多个路径操作函数

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 3.9 | active | — | — |
| 3.10 | active | — | — |

## Workarounds

1. **合并重复的路径操作** (95% success)
   ```
   def get_items():
    # 合并逻辑
    pass
@app.get('/items')
@app.get('/items/')  # 使用路径别名
   ```
2. **使用不同的路径** (90% success)
   ```
   @app.get('/items')
@app.get('/products')  # 改为不同路径
   ```

## Dead Ends

- **删除其中一个函数但保留逻辑** — 功能丢失 (70% fail)
- **使用不同的 HTTP 方法** — 可能不符合 RESTful 设计 (60% fail)
