request_validation_exception_handler
Handles FastAPI RequestValidationError by returning a JSONResponse with a 422 status code and a detailed list of validation errors.
def request_validation_exception_handler(
request: Request,
exc: RequestValidationError
) - > JSONResponse
Handles FastAPI RequestValidationError by returning a JSON response containing the validation error details.
Parameters
| Name | Type | Description |
|---|---|---|
| request | Request | The incoming HTTP request object that triggered the validation error. |
| exc | RequestValidationError | The exception instance containing the specific validation errors encountered during request processing. |
Returns
| Type | Description |
|---|---|
JSONResponse | A JSON response with a 422 status code and a body containing the serialized validation error details. |