# 值错误：未知的路径转换器 'int'

- **ID:** `python/starlette-route-param-converter`
- **领域:** python
- **类别:** config_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

使用了 Starlette 不支持的路径转换器，如 int 但语法不正确。

## 版本兼容性

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

## 解决方案

1. **** (100% 成功率)
   ```
   Use the correct syntax: @app.route('/items/{item_id:int}')
   ```
2. **** (95% 成功率)
   ```
   In FastAPI, use type annotation: @app.get('/items/{item_id}') with item_id: int
   ```

## 无效尝试

- **** — Starlette uses {item_id:int} syntax, but it must be exactly that; if you use {item_id} with a type annotation, it's different. (70% 失败率)
- **** — The converter is built-in; no import needed. (30% 失败率)
