Esempio n. 1
0
async def handle_validation_error(
    request: Request, exc: pydantic.error_wrappers.ValidationError
):  # pylint: disable=unused-argument
    """
    Handles validation errors.
    """
    return JSONResponse({"message": exc.errors()}, status_code=422)
Esempio n. 2
0
async def handle_validation_error(
    request: fastapi.Request, exc: pydantic.error_wrappers.ValidationError
):
    """
    Handles validation errors.
    """
    return fastapi.responses.JSONResponse({'message': exc.errors()}, status_code=422)