# AssertionError: Duplicate path parameter: 'item_id'

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

## Root Cause

FastAPI路由中定义了相同名称的路径参数，导致参数冲突

## Version Compatibility

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

## Workarounds

1. **重命名其中一个路径参数** (95% success)
   ```
   @app.get('/items/{item_id}')
@app.get('/items/{other_id}')
   ```
2. **合并为单个路由并处理不同逻辑** (90% success)
   ```
   @app.get('/items/{item_id}')
async def read_item(item_id: int): pass
   ```

## Dead Ends

- **尝试更改路由顺序而不修改参数名** — 参数名重复是根本问题，顺序无关 (50% fail)
- **使用不同的HTTP方法但保留相同参数名** — 参数名冲突发生在同一路由组内 (30% fail)
