You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was sending custom HttpErrors that changes the response to the user but I can't do this when I'm validating request bodies because it's using the one that came with the library.
This is the response I want to throw when a validation fails;
{
"status": false,
"message": "Validation errors.",
"errors": "ValidationError[] from class validator"
}
This is what it currently returns
{
"name": "BadRequestError",
"message": "Invalid body, check 'errors' property for more info.",
"errors": "ValidationError[] from class validator"
}
One way that I could find is to use this but since I'm using Koa I can't use it.
One workaround for this is disabling the validator from @Body() and calling class-validator inside the request function.
mjmarianetti, kfurfles, arnold095, kasir-barati and crgeary