title: FOSRestBundle custom view handler not registering
body: <p>I'm trying to create custom handler for serializing response into csv format.</p>
  
  <p>So far I've been following the steps from documentation (<a href="http://symfony.com/doc/master/bundles/FOSRestBundle/2-the-view-layer.html#custom-handler" rel="nofollow">http://symfony.com/doc/master/bundles/FOSRestBundle/2-the-view-layer.html#custom-handler</a>), however when calling my endpoint with .csv extension I still get the error: </p>
  
  <p><code>The format "csv" is not supported for serialization.</code></p>
  
  <p>Here's my <code>services.yml</code> config bit:</p>
  
  <pre><code>api.csv_handler:
      class: ApiBundle\ViewHandlers\CsvViewHandler
  
  api.view_handler:
      parent: fos_rest.view_handler.default
      calls:
          - ["registerHandler", ["csv", ["@api.csv_handler", "createResponse"]]]
  </code></pre>
  
  <p>and in <code>config.yml</code>, under <code>fos_rest</code> I have this:</p>
  
  <pre><code>view:
      mime_types: { 'csv': ['text/csv','text/plain'] }
      view_response_listener: 'force'
      formats:
          json: true
          xml:  true
          csv:  true
      templating_formats:
          html: true
  format_listener:
      enabled: true
      rules:
          - { path: ^/, priorities: [ json, xml, csv ], fallback_format: json, prefer_extension: false }
          - { path: ^/api/doc, priorities: [ html ], fallback_format: html, prefer_extension: false }
  </code></pre>
  
  <p>The <code>createResponse</code> method inside my <code>CsvViewHandler</code> class currently only contains some debug code to verify if it's working, which it isn't.</p>
  
  <p>So what am I missing here?</p>