# 值错误：路径操作中存在重复的参数名称'item_id'

- **ID:** `python/starlette-path-operation-conflict`
- **领域:** python
- **类别:** config_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

路由中的多个路径参数具有相同的名称，导致歧义。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 3.x | active | — | — |

## 解决方案

1. **Rename one of the path parameters to be unique** (95% 成功率)
   ```
   @app.route('/items/{item_id}/details/{detail_id}')
async def get_detail(item_id: str, detail_id: str):
    ...
   ```
2. **Combine parameters into a single path segment** (85% 成功率)
   ```
   @app.route('/items/{item_id}')
async def get_item(item_id: str):
    ...
   ```

## 无效尝试

- **Removing one of the parameters without adjusting the route** — Breaks the route logic; URL pattern becomes incorrect. (80% 失败率)
- **Using different variable names but same path segment** — Starlette still sees duplicate path parameters. (90% 失败率)
