When I used an older version of the validator it was like this:
{
"success": false,
"error": [
{
"value": "mclarenlo.cards",
"property": "email",
"children": [],
"constraints": {
"isEmail": "email must be an email"
}
}
],
"time": 1701174874
}
But after the update, the application's response changed:
{
"success": false,
"error": [
"email must be an email"
],
"time": 1701174816
}
How can I keep the new validator but change the response as before?
Super simple, just map your error like this:
All you have to do is modulate as you see fit.