'Symfony validator conditional validation
* @Assert\Type(type="array")
* @Assert\Count(
* min=5,
* max=10
* )
I need validate a type array and then I need to validate if the array has a min and max count.
But when I send a string value, then Assert\Type evaluates that's not a valid type, but despite that validation continues to Assert\Count and there is problem it is not an array and Assert\Count throw UnexpectedValueException and I have message: This value should be of type {{ type }}., and the that's not the correct validation message for me.
Is possible do Assert\Count only when is Assert\Type condition correct?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
