title: JMS Serializer Annotation Group not working on Entity using Symfony 4
body: <p>I have been using the Group annotation for years on SF2 and SF3.
  I'm trying SF4.1. And I'm getting an empty JSON when I send a GET to my endpoint.</p>
  
  <p>The interesting parts of my composer.json:</p>
  
  <pre><code> "friendsofsymfony/rest-bundle": "^2.3",
   "jms/serializer-bundle": "^2.3",
   "sensio/framework-extra-bundle": "^5.1",
   "symfony/serializer-pack": "^1.0"
  </code></pre>
  
  <p>The config:</p>
  
  <pre><code>framework:
      serializer:
         enabled: true
         enable_annotations: true
  
  sensio_framework_extra:
      view: { annotations: true }
  
  fos_rest:
     routing_loader:
          default_format: json
  
     view:
          view_response_listener: 'force'
  
     format_listener:
          rules:
                 - { path: ^/, prefer_extension: true, fallback_format: json, priorities: [ json,xml, html  ] }
  </code></pre>
  
  <p>The Entity</p>
  
  <pre><code>use JMS\Serializer\Annotation\Groups;
  
  class User implements UserInterface, \Serializable
  {
  
  private $id;
  
  /**
   * @Groups({"api"})
   */
  private $username;
  </code></pre>
  
  <p>And the endpoint API Controller:</p>
  
  <pre><code>use FOS\RestBundle\Controller\FOSRestController;
  use FOS\RestBundle\Context\Context;
  use FOS\RestBundle\View\View;
  
  class UserController extends FOSRestController {
  
  public function getUserAction(Request $request, EntityManagerInterface $em)
  {
      $user = $em-&gt;getReference('App:User', 1);
      $view = View::create();
      $context = new Context();
      $context-&gt;setGroups(['api']);
      $view-&gt;setContext($context);
      $view-&gt;setData($user);
      return $this-&gt;handleView($view);
   }
  }
  </code></pre>
  
  <p>If I remove `$context->setGroups(['api']), the JSON has all the User attributes. </p>
  
  <p>Any idea? Thanks!</p>
  
  <p><strong>Debug Info:</strong></p>
  
  <pre><code>bin/console debug:container jms
  </code></pre>
  
  <p>Select one of the following services to display its information [fos_rest.serializer.jms]:
    [0] fos_rest.serializer.jms</p>
  
  <blockquote>
    <p>0</p>
  </blockquote>
  
  <p>Information for Service "fos_rest.serializer.jms"
   =================================================</p>
  
  <hr>
  
  <p>Option           Value                                           </p>
  
  <hr>
  
  <p>Service ID       fos_rest.serializer.jms<br>
    Class            FOS\RestBundle\Serializer\JMSSerializerAdapter<br>
    Tags             -<br>
    Public           no<br>
    Synthetic        no<br>
    Lazy             yes<br>
    Shared           yes<br>
    Abstract         no<br>
    Autowired        no<br>
    Autoconfigured   no                                              </p>
  
  <hr>