# fastapi.exceptions.RequestValidationError: [{'loc': ['body', 'age'], 'msg': 'value is not a valid integer', 'type': 'type_error.integer'}]

- **ID:** `python/fastapi-body-validation-error`
- **Domain:** python
- **Category:** type_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

The request body contains a field that fails type validation, e.g., a string where an integer is expected.

## Version Compatibility

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

## Workarounds

1. **** (95% success)
   ```
   Ensure the client sends valid data types: age: 25 instead of age: "twenty-five".
   ```
2. **** (85% success)
   ```
   Add custom validation logic or use Pydantic's Field constraints to give better error messages.
   ```

## Dead Ends

- **** — It doesn't help the client correct the input; the error persists. (80% fail)
- **** — This bypasses validation and can lead to runtime errors when processing the data. (60% fail)
