Category: symfony-validator

How to use normalizer option in Symfony constraints component

The documentation https://symfony.com/doc/4.4/reference/constraints/Length.html#normalizer states that This option allows to define the PHP callable applied to the given value before checking if it is valid. For example, you may want to pass the ‘trim’ string to apply the trim PHP function…

Symfony "fos_rest.request_body" converter: do not deserialize nested DTO classes

I have a OrderDto class with a nested PointDto class (array of points): class OrderDto { /** * @var PointDto[] * @AssertAll({ * @AssertType(“AppDtoPointDto”) * }) * @AssertValid() */ private array $points; // getters, setters } The PointDto class also…