8000 Extra-field detection in violation list · Issue #16142 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
Extra-field detection in violation list #16142
Closed
@blanchonvincent

Description

@blanchonvincent

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0