title: JMS Serializer ignores mappings for Knp Paginator
body: <p>I have problem with exclusion of some KNP Paginator properties with JMS Serializer.</p>
  
  <p>First, this is included in composer.json</p>
  
  <pre><code>...
  "jms/serializer-bundle": "~0.13",
  "knplabs/knp-paginator-bundle": "2.4.*@dev",
  ...
  </code></pre>
  
  <p>I'm paginating CrmContacts entity and exclusion policy for that entity works well. I also added yml file for KNP Paginator like this:</p>
  
  <p>config.yml</p>
  
  <pre><code>jms_serializer:
      metadata:
          directories:
              KNPPB:
                  namespace_prefix: 'Knp\\Bundle\\PaginatorBundle'
                  path: %kernel.root_dir%/Resources/serializer/Knp
  </code></pre>
  
  <p>inside app/Resources/serializer/Knp folder I've created Pagination.SlidingPagination.yml:</p>
  
  <pre><code>Knp\Bundle\PaginatorBundle\Pagination\SlidingPagination:
      exclusion_policy: ALL
          properties:
              items:
                  expose: true
                  access_type: public_method
                  accessor:
                      getter: getItems
                  type: array
                  serialized_name:
                      payload
              currentPageNumber:
                  expose: true
                  serialized_name:
                      page
              numItemsPerPage:
                  expose: true
                  serialized_name:
                      items
              totalCount:
                  expose: true
                  serialized_name:
                      totalItems
  </code></pre>
  
  <p>and this is logic for returning serialized data:</p>
  
  <pre><code>public function getContactsAction(Request $request)
  {
  
      $limit = $request-&gt;query-&gt;getInt('l', 10);
      $page = $request-&gt;query-&gt;getInt('p', 1);
  
      $serializer = $this-&gt;get('jms_serializer');
  
      $contacts = $this-&gt;getDoctrine()
          -&gt;getManager()
          -&gt;getRepository('AcmeContactsBundle:CrmContact')
          -&gt;getContacts();
  
      $paginator = $this-&gt;get('knp_paginator');
      $pagination = $paginator-&gt;paginate(
          $contacts,
          $page,
          $limit
      );
  
      return new Response(
          $serializer-&gt;serialize(
              $pagination,
              'json',
              SerializationContext::create()-&gt;setGroups(['Default'])
          ),
          Response::HTTP_OK,
          [
              'Content-Type' =&gt; 'application/json',
          ]
      );
  
  }
  </code></pre>
  
  <p>Unfortunately, I'm getting all properties from Knp Paginator in response:</p>
  
  <pre><code>{
      "currentPageNumber": 1,
      "numItemsPerPage": 10,
      "items": [
          {
              "id": 1,
              ...
          },
          {
              "id": 2,
              ...
          },
          {
              "id": 3,
              ...
          }
      ],
      "totalCount": 3,
      "paginatorOptions": {
          "pageParameterName": "page",
          "sortFieldParameterName": "sort",
          "sortDirectionParameterName": "direction",
          "filterFieldParameterName": "filterField",
          "filterValueParameterName": "filterValue",
          "distinct": true
      },
      "customParameters": [],
      "route": "acmeContactsGetContacts",
      "params": [],
      "pageRange": 5,
      "template": "KnpPaginatorBundle:Pagination:sliding.html.twig",
      "sortableTemplate": "KnpPaginatorBundle:Pagination:sortable_link.html.twig",
      "filtrationTemplate": "KnpPaginatorBundle:Pagination:filtration.html.twig"
  }
  </code></pre>