title: JMSSerializerBundle. no control over third party meta data
body: <p>I have two entities I wish to serialize with the JMSSerializerBundle. The <code>Music</code> Entity has a mapping-file with <code>exclusion_policy: NONE</code>.</p>
  
  <p>The <code>Music</code> entity has a field of the entity <code>User</code> from <code>FOSUserBundle</code>. The <code>User</code> entity has a mapping-file with <code>exclusion_policy: ALL</code> with a few fields set to <code>expose: true</code>, so they will be serialized.</p>
  
  <p>The problem is, the <code>User</code> field gets fully serialized. It does not matter if I change the mapping-file of the <code>User</code> entity.</p>
  
  <p>This is how it looks:</p>
  
  <pre><code>#My/Bundle/Resources/config/serializer/Entity.Music.yml
  xxx\xxx\Entity\Music:
      exclusion_policy: NONE
  
  #My/Bundle/Resources/config/serializer/Entity.User.yml
  xxx\xxx\Entity\User:
      exclusion_policy: ALL
      properties:
          id:
              expose: true
          username:
              expose: true
          username_canonical:
              exclude: true
          email:
              exclude: true
          email_canonical:
              exclude: true
          enabled:
              exclude: true
          salt:
              exclude: true
          password:
              exclude: true
          last_login:
              exclude: true
          confirmation_token:
              exclude: true
          password_requested_at:
              exclude: true
          groups:
              exclude: true
          locked:
              exclude: true
          expired:
              exclude: true
          expires_at:
              exclude: true
          roles:
              expose: true
          credentials_expired:
              exclude: true
          credentials_expired_at:
              exclude: true
  </code></pre>
  
  <p>Why does it not refer to it's own mapping file? Or am I mistaken somewhere?</p>
  
  <h2>What have I tried thusfar</h2>
  
  <p>I have read the third party meta data documentation. It simply says to add a new directory in my serializer service. I have done that, but I have to extend the <code>FOS\UserBundle\Entity</code> class, and that also does not have access to the parent protected fields I'm trying to exclude.</p>