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
Once I realised that ConstraintViolation already accepts $code as the eighth param I did consider doing this same thing but don't really want to maintain duplicates of the validators.
For now I will use the constraint message as an internal code, and map it to an external code and message.
Hi @andyj8, thank you for reporting this ticket! This is a duplicate of #7273. As of #11657 (2.6), it is possible to call getConstraint() on the ConstraintViolation object. We're discussing whether to add additional codes in #7273. Join the discussion!
Seems to me that most APIs will assign unique error codes to each potential validation error, in addition to human-readable messages.
Before considering a PR, I wonder what the consensus on adding the ability to add a 'code' property to each field constraint would be?
The text was updated successfully, but these errors were encountered: