<p dir="auto">When creating a form type class with a default validation_group (using validation_groups key in default options array), I found that the specified group is not taken into account when generating the form for the NotBlank assert annotation (and most liekly the NotNull one as well).</p>
<p dir="auto">When adding a NotBlank assert annotations to a model (or entity) class with a group application filter (groups attribute for the annotation) and generating a form view for this class (via a form type specifying the default validation group or another validation group), the Not Blank annotation is always processed before rendering the form and the field always ends up with a require="required" attribute.</p>
<p dir="auto">The validation_groups options of the form type class should always be taken into account when generating a form. Right now it is not correctly processed and the generated form does not match the expected result ; the only way I found to fix this behaviour without going into the symfony core classes was to render each field using an attribute "required" =&gt; false when rendering the field using the form_(row|widget) twig tag.</p>
<p dir="auto">The <code class="notranslate">ValidatorTypeGuesser</code> does not consider the current form's <code class="notranslate">validation_groups</code> option when guessing type. This could be fixed by passing the options array to the guesser methods. The signature of the <code class="notranslate">FormTypeGuesserInterface</code> methods would look like this:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="function guessType($class, $property, array $options = array());"><pre class="notranslate"><code class="notranslate">function guessType($class, $property, array $options = array());
</code></pre></div>
<p dir="auto">The default argument is provided for BC.</p>