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
$violations = $this->validator->validate($data, new UserConstraintList());
I don't find what is the best solution to detect extra-field violation.
Actually, in my app, extra field is not an error but I want to notice end-user that some extra fields has been sent.
I thought that the code const NO_SUCH_FIELD_ERROR = 2; was a good way to detect it, but a lot of constraints has the same code (2) :/
So, for now, to detect if an extra field error is inside the violation list, I have to check the error message ... it's really dirty but I don't find other solutions.
Any ideas?
The text was updated successfully, but these errors were encountered:
When I validate some data :
$violations = $this->validator->validate($data, new UserConstraintList());
I don't find what is the best solution to detect extra-field violation.
Actually, in my app, extra field is not an error but I want to notice end-user that some extra fields has been sent.
I thought that the code
const NO_SUCH_FIELD_ERROR = 2;
was a good way to detect it, but a lot of constraints has the same code (2) :/So, for now, to detect if an extra field error is inside the violation list, I have to check the error message ... it's really dirty but I don't find other solutions.
Any ideas?
The text was updated successfully, but these errors were encountered: