Skip to content

Extra-field detection in violation list #16142

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
blanchonvincent opened this issue Oct 6, 2015 · 1 comment
Closed

Extra-field detection in violation list #16142

blanchonvincent opened this issue Oct 6, 2015 · 1 comment

Comments

@blanchonvincent
Copy link
Contributor

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?

@blanchonvincent
Copy link
Contributor Author

Closed with #15154

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants