# 断言错误：'response' 参数不是有效的响应类

- **ID:** `python/fastapi-redirect-response-error`
- **领域:** python
- **类别:** config_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

在 FastAPI 路由中使用了错误的 response 参数类型。

## 版本兼容性

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

## 解决方案

1. **** (100% 成功率)
   ```
   @app.get('/item', response_model=Item)
async def get_item():
    return Item(name='test', price=10)
   ```

## 无效尝试

- **** — None 不是有效的响应类 (90% 失败率)
- **** — 会导致响应格式不正确 (70% 失败率)
