title: Nelmio API doc bundle post request with boolean always returns true
body: <p>I'm developping a Symfony 4 API REST app with Nelmio Api Doc Bundle v3.</p>
  
  <p>I am sending this request :</p>
  
  <pre><code>curl -X POST "http://dev.api_events.jessie/api/event-types" -H "accept: application/json" -H "Authorization: Bearer ZmU1MTgxNzNkZjM5ZTU2NzdiODVkODgxMmE2ZmE2OWUyMjY1ZWIxYzgxMjdlOTA3NjBiODM5Yzg1NTEzNjFlYw" -H "Content-Type: application/x-www-form-urlencoded" -d "fullName=aaaaaaaaaaa&amp;shortName=aaaaaaaaaaa&amp;dns=aaaaaaaaaa**&amp;mandatoryRegistration=false"**
  </code></pre>
  
  <p>This is the response body :</p>
  
  <pre><code>{
    "id": 19,
    "full_name": "aaaaaaaaaaa",
    "short_name": "aaaaaaaaaaa",
    "dns": "aaaaaaaaaa",
    **"mandatory_registration": true,**
    "places": [],
    "participation_types": []
  }
  </code></pre>
  
  <p>I have absolutely no idea why i send mandatoryRegistration=false and my response have "mandatory_registration": true.</p>
  
  <p>I paste my Controller, Form, Entity code below. And the nelmio api doc and fos_rest configuration code.</p>
  
  <p>Controller :</p>
  
  <pre><code> /**
   * Creates a new eventType entity.
   *
   * @Route("/event-types", methods="POST")
   * @Operation(
   *     tags={"event_type"},
   *     summary="Creates a new event type entity",
   *     consumes={"application/x-www-form-urlencoded"},
   *     @SWG\Parameter(
   *         name="Authorization",
   *         in="header",
   *         description="Bearer",
   *         required=true,
   *         type="string"
   *     ),
   *    @SWG\Parameter(
   *         name="fullName",
   *         in="formData",
   *         description="event type full name",
   *         required=true,
   *         type="string"
   *     ),
   *     @SWG\Parameter(
   *         name="shortName",
   *         in="formData",
   *         description="event name",
   *         required=true,
   *         type="string"
   *     ),
   *     @SWG\Parameter(
   *         name="dns",
   *         in="formData",
   *         description="event type dns",
   *         required=true,
   *         type="string"
   *     ),
   *     @SWG\Parameter(
   *         name="mandatoryRegistration",
   *         in="formData",
   *         description="is the registration mandatory?",
   *         required=true,
   *         type="boolean"
   *     ),
   *     @SWG\Response(
   *         response=Response::HTTP_CREATED,
   *         description="Event Type created",
   *        @Model(type=EventType::class, groups={"event_type"})
   *     )
   * )
   *
   */
  public function postEventTypeAction(Request $request, EntityManagerInterface $em)
  {
      $event_type = new EventType();
      $form = $this-&gt;createForm(EventTypeType::class, $event_type);
      $form-&gt;submit($request-&gt;request-&gt;all()); // Validation des données
  
  
      if ($form-&gt;isValid()) {
          $em-&gt;persist($event_type);
          $em-&gt;flush();
  
          return View::create($event_type, Response::HTTP_CREATED , []);
      }
      else{
          return View::create($form, Response::HTTP_BAD_REQUEST , []);
      }
  
  }
  </code></pre>
  
  <p>EventType form :</p>
  
  <pre><code>class EventTypeType extends AbstractType
  {
      /**
       * {@inheritdoc}
       */
      public function buildForm(FormBuilderInterface $builder, array $options)
      {
          $builder-&gt;add('fullName'
          )
                  -&gt;add('shortName')
                  -&gt;add('dns')
                  -&gt;add('mandatoryRegistration')
          ;
      }
  
      /**
       * {@inheritdoc}
       */
      public function configureOptions(OptionsResolver $resolver)
      {
          $resolver-&gt;setDefaults(array(
              'data_class' =&gt; EventType::class
          ));
      }
  
      /**
       * {@inheritdoc}
       */
      public function getBlockPrefix()
      {
          return 'event_type';
      }
  }
  </code></pre>
  
  <p>EventType entity :</p>
  
  <pre><code>class EventType
  {
      /**
       * @var int
       *
       * @ORM\Column(name="id", type="integer")
       * @ORM\Id
       * @ORM\GeneratedValue(strategy="AUTO")
       * @Groups({"event_type","place"})
       */
      private $id;
  
  /**
   * @var string
   *
   * @ORM\Column(name="full_name", type="string", length=255, unique=true)
   * @Groups({"event_type","place","event_type_form_data"})
   */
  private $fullName;
  
  /**
   * @var string
   *
   * @ORM\Column(type="string", length=255, unique=true)
   * @Groups({"event_type","place","event_type_form_data"})
   */
  private $shortName;
  
  /**
   * @var string
   *
   * @ORM\Column(name="dns", type="string", length=255, unique=true)
   * @Groups({"event_type","event_type_form_data"})
   */
  private $dns;
  
  /**
   * @var bool
   *
   * @ORM\Column(name="mandatory_registration", type="boolean", nullable=true)
   * 
   * @Groups({"event_type","event_type_form_data"})
   */
  private $mandatoryRegistration;
  
   /**
   * @ORM\OneToMany(targetEntity="Place", mappedBy="eventType", cascade={"persist"})
   */
  private $places;
  
   /**
   * @ORM\OneToMany(targetEntity="EventTypeParticipationType", mappedBy="eventType", cascade={"persist"})
   */
  private $participationTypes;
  </code></pre>
  
  <p>Config :</p>
  
  <pre><code>nelmio_api_doc:
  documentation:
      info:
          title: Api Events
          description: L4M Admin Events access point.
          version: 1.0.0
      security_definitions:
          api_key:
              type: apiKey
              name: authorization
              in: header
      security: 
          api_key: []
      sandbox:
          request_format:
              method: accept_header
          accept_type: application/json
          body_format: 
              formats: [ form, json ]             # array of enabled body formats,
                                              # remove all elements to disable the selectbox
              default_format: form         
  
  areas: # to filter documented routes
      path_patterns:
          - ^/api(?!/doc$) # Accepts routes under /api except /api/doc
          - ^/oauth/v2/token
  
  fos_rest:
      param_fetcher_listener:  true
      body_listener: true
      #allowed_methods_listener:  true
      routing_loader: true
      view:
          view_response_listener:  true
          formats:
              json: true
  
  # exception:
  #     codes:
  #         App\Exception\MyException: 403
  #     messages:
  #         App\Exception\MyException: Forbidden area.
  
  format_listener:
      enabled: true
      rules:
          - { path: ^/, prefer_extension: false, fallback_format: json, priorities: [ json, xml, html ] }
  </code></pre>