Description
To get an entity's fields to show correctly in the NelmioApiDoc output I added @Assert\Optional() constraint to the phpdoc, and now I get a ClassNotFoundException.
It seems the ConstraintValidatorFactory is trying to load a OptionalValidator
class to handle the Optional constraint. I assume the same issue would occur with the Required constraint as the RequiredValidator
is also missing.
I'm using Symfony 2.4.5.
I may be using the constraint incorrectly?
ClassNotFoundException: Attempted to load class "OptionalValidator" from namespace "Symfony\Component\Validator\Constraints" in /var/www/server/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Validator/ConstraintValidatorFactory.php line 71. Do you need to "use" it from another namespace?