I have read about new feature:
symfony 4.3 Automatic validation
https://symfony.com/blog/new-in-symfony-4-3-automatic-validation
So Doctrine annotation should suffice without
explicitly manually adding Validator annotations
( like @Assert\NotNull()
..)
Yet I do not understand how to make it work.
I have symfony 4.3 application, currently create Entities,
really do not want to add Validator annotations manually
but use this new Automatic validation feature.
I am newby to Symfony,
please be detailed.
//$post is Entity with title notNull property
$errors = $validator->validate($post);
/**
* @var string
*
* @Assert\NotNull()
* @ORM\Column(name="title", type="string", length=10, nullable=false)
*/
It should work without explicitly adding
@Assert\NotNull()
but it doesn't