# fastapi.exceptions.RequestValidationError: 422 Unprocessable Entity

- **ID:** `python/fastapi-request-validation-error-missing-field`
- **Domain:** python
- **Category:** data_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Request body or query parameters do not match the expected Pydantic model schema, such as missing required fields or incorrect types.

## Version Compatibility

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

## Workarounds

1. **** (95% success)
   ```
   Define a custom exception handler: @app.exception_handler(RequestValidationError)\nasync def validation_exception_handler(request, exc):\n    return JSONResponse(status_code=422, content={"detail": exc.errors()})
   ```
2. **** (85% success)
   ```
   Use Pydantic's Field(..., description='...') to document requirements and ensure clients send correct data.
   ```

## Dead Ends

- **** — Catching the exception globally and returning a generic 400 hides the specific field issues, making debugging harder. (60% fail)
- **** — Disabling validation with model_config = {'extra': 'allow'} can allow invalid data through, causing downstream errors. (80% fail)
