Skip to content

No $errorNames in UniqueEntity constraint #19447

@TobiasXy

Description

@TobiasXy

It seems all (or at least most) of the base validation constraints (Symfony\Component\Validator\Constraints) set an error code when they are building the ConstraintViolation.

But: The UniqueEntity constraint (\Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity) does not.
I currently create an API where I want to provide the users error codes with every constraint violation.
How am I supposed to do that with the UniqueEntity constraint (or more general with Constraints which do not set an error code)?

Wouldn't it be good to make the error code required for ConstraintViolations?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions