Using metadata classes of Symfony's validator component.