Files
users/src/presentation/handlers/validation_handler.py
2026-05-14 21:45:43 +03:00

11 lines
335 B
Python

from fastapi import Request
from fastapi.exceptions import RequestValidationError
from fastapi.responses import ORJSONResponse
async def validation_exception_handler(_request: Request, exc: RequestValidationError) -> ORJSONResponse:
return ORJSONResponse(
status_code=422,
content={'detail': exc.errors()},
)