-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Closed
Description
Description
Now that UniqueValidator supports providing which fields to check for uniqueness it would be also useful to be able to provide errorPath like in UniqueEntityValidator
.
Otherwise the errors are not shown when you use Form CollectionType and with an array of DTO's and normalizer
option.
Example
class Input {
/** @var MetadataInput[] */
#[Unique(normalizer: [MetadataInput::class, 'getKeyForUniqueConstraint'], errorPath: 'key')
public $metadata;
}
class MetadataInput {
public $key;
public $value;
}