title: How to match Form Type with Request?
body: <p>Request JSON: </p>
  
  <pre><code>{"vpnusers": {"expire_account": "2017-11-27 16:28:15", "status_id": 1}}
  </code></pre>
  
  <p>The result printed (in the controller):</p>
  
  <pre><code>print_r($request-&gt;get('vpnusers'));
  Array
  (
      [expire_account] =&gt; 2017-11-27 16:28:15
      [status_id] =&gt; 1
  )
  </code></pre>
  
  <p>VpnUsersType:</p>
  
  <pre><code>namespace Hoax\PartnerBundle\Form\Type;
  
  use Symfony\Component\Form\AbstractType;
  use Symfony\Component\Form\FormBuilderInterface;
  use Symfony\Component\OptionsResolver\OptionsResolverInterface;
  
  class VpnUsersType extends AbstractType
  {
      /**
       * @param FormBuilderInterface $builder
       * @param array $options
       */
      public function buildForm(FormBuilderInterface $builder, array $options)
      {
          $builder
              -&gt;add('status_id')
              -&gt;add('expire_account')
          ;
      }
  
      /**
       * @param OptionsResolverInterface $resolver
       */
      public function setDefaultOptions(OptionsResolverInterface $resolver)
      {
          $resolver-&gt;setDefaults(array(
              'data_class' =&gt; 'Hoax\PartnerBundle\Entity\VpnUsers'
              , 'csrf_protection' =&gt; false
          ));
      }
  
      /**
       * @return string
       */
      public function getName()
      {
          return 'vpnusers';
      }
  }
  </code></pre>
  
  <p>I have just followed this guide and can see there's no such issue as I have: <a href="http://williamdurand.fr/2012/08/02/rest-apis-with-symfony2-the-right-way/" rel="nofollow">http://williamdurand.fr/2012/08/02/rest-apis-with-symfony2-the-right-way/</a></p>