title: Setting serialization groups for entity in other bundle with FOSRestBundle / JMSSerializerBundle
body: <p>I have a simple REST api created using FOSRestBundle, and returns serialized objects using JMSSerializerBundle.</p>
  
  <p>One of the entities of my bundle uses an entity located in another bundle.</p>
  
  <p>I set up serialization groups for my entity, but they are obviously not set for the aggregated entity so its json result is empty.</p>
  
  <p>I've followed the documentation for YAML groups configuration: <a href="http://jmsyst.com/libs/serializer/master/reference/yml_reference" rel="nofollow">http://jmsyst.com/libs/serializer/master/reference/yml_reference</a> but the file seems to be unused (adding groups to the entity's properties has no effect, and I don't get any errors if my YAML file is invalid).</p>
  
  <p>Here's the code:</p>
  
  <blockquote>
    <p>MyCompany\MyBundle\Entity\Meeting.php</p>
  </blockquote>
  
  <pre><code>class Meeting
  {
    /**
     * @var Point
     *
     * @ORM\Column(name="location", type="point", nullable=true)
     * @JMS\Groups({"privateContact"})
     */
    private $location;
  
    // Getters, setters and other stuff
  }
  </code></pre>
  
  <blockquote>
    <p>ACME\SomeBundle\ORM\Point.php</p>
  </blockquote>
  
  <pre><code>class Point
  {
    /**
     * @var float
     */
    private $latitude;
  
    /**
     * @var float
     */
    private $longitude;
  
    // Getters, setters
  }
  </code></pre>
  
  <blockquote>
    <p>MyCompany\MyBundle\Resources\config\serializer\Model.Point.yml</p>
  </blockquote>
  
  <pre><code>ACME\SomeBundle\ORM\Point:
      properties:
          latitude:
              groups: ['privateContact']
          longitude:
              groups: ['privateContact']
  </code></pre>
  
  <blockquote>
    <p>MyCompany\MyBundle\Controller\ApiController.php</p>
  </blockquote>
  
  <pre><code>/**
   * @Rest\View(serializerGroups={"privateContact"})
   */
  public function getMeetingAction()
  {
    ...
  
    return array(
      'status' =&gt; 'OK',
      'meeting' =&gt; $meeting
    );
  }
  </code></pre>
  
  <blockquote>
    <p>Resulting JSON</p>
  </blockquote>
  
  <pre><code>"meeting":{"id":10,"date":"2015-07-16T19:20:00+0200","location":{}}
  </code></pre>