-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Closed
Description
Symfony version(s) affected
6.x
Description
Validation of Ulid
string got by $ulid->toRfc4122()
(e.g. 018a5293-72b6-c9b0-4361-7ce3d6c2e4ef
) creates validation violation.
there is strict string length validation here and it fails (the rfc4122
string is 36
chars long)
symfony/src/Symfony/Component/Validator/Constraints/UlidValidator.php
Lines 46 to 53 in 73a6b4b
if (26 !== \strlen($value)) { | |
$this->context->buildViolation($constraint->message) | |
->setParameter('{{ value }}', $this->formatValue($value)) | |
->setCode(26 > \strlen($value) ? Ulid::TOO_SHORT_ERROR : Ulid::TOO_LONG_ERROR) | |
->addViolation(); | |
return; | |
} |
How to reproduce
- create new
Ulid
- get it's
rfc4122
formated string value - try to validate it with
UlidValidator
Possible Solution
allow other ulid formats in validator
Additional Context
No response