When I use fluentvalidation in the normal form I have one response, but when I tried to use it mannually I have another response, how can I get the same response manually?
Normal Response
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-dc7d6c683021ab4e8b3e2db42748e569-ec9d9967213d614c-00",
"errors": {
"LicensePlate": [
"'License Plate' não pode ser nulo."
]
}
}
Manual
public ActionResult<ResponseUpdateLeadVehicleDTO> ChangeLeadPlate1(int id, [CustomizeValidator(Skip = true)]RequestUpdateLeadVehicleDTO request)
{
if (!validation.IsValid)
{
validation.AddToModelState(ModelState, null);
return BadRequest(ModelState);
}
}
response
{
"LicensePlate": [
"'License Plate' não pode ser nulo."
]
}