# fastapi.exceptions.RequestValidationError: value is not a valid integer

- **ID:** `python/fastapi-query-parameter-validation`
- **Domain:** python
- **Category:** data_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

查询参数或路径参数的类型不匹配，例如传入了字符串而不是整数。

## Version Compatibility

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

## Workarounds

1. **** (100% success)
   ```
   @app.get('/items/{item_id}')
async def get_item(item_id: int):
    return {'item_id': item_id}
   ```

## Dead Ends

- **** — FastAPI 会在函数执行前验证，转换无效 (90% fail)
- **** — 会忽略验证错误，导致数据不一致 (80% fail)
