title: Prevent Symfony's CheckboxType casting strings to bool
body: <p>I am working on a Symfony 5.4 REST API and validating a user's input using FormTypes. I have a required  boolean field and would like to <strong>throw a form exception if I receive any non-boolean input for that field</strong>. However, Symfony's CheckboxType automatically sets any non-boolean input to <code>true</code> when I submit the form, so I can not check if my input was a legit boolean.</p>
  <p>My code looks like this:</p>
  <pre><code>        $inputModel= new InputModel();
          $this-&gt;form-&gt;setData($inputModel);
          if ($this-&gt;request-&gt;isMethod('PUT')) {
              // Here the vaue of $this-&gt;request-&gt;request-&gt;all()['myBooleanField'] is &quot;asdf&quot;
              $this-&gt;form-&gt;submit($this-&gt;request-&gt;request-&gt;all());
              // Here the value of inputModel-&gt;getMyBooleanField() is true
              //...
          }
  </code></pre>
  <p>My FormType <code>buildForm</code> method looks like this:</p>
  <pre><code>public function buildForm(FormBuilderInterface $builder, array $options): void
  {
      $builder
          //...
          -&gt;add('myBooleanField', typeForm\CheckboxType::class, [ 'required' =&gt; true ])
          //...
          ;
  }
  </code></pre>
  <p>Any help is appreciated!</p>