FOSRestBundle is not considering the format in my URL
<p>I want to consider the format extension in my URLs so that it takes the highest priority for the <code>_format</code> parameter. My configuration is the following one:</p>

<pre><code>fos_rest:
    param_fetcher_listener: true
    view:
        view_response_listener: 'force'
        formats:
          json: true
          xml: true
    routing_loader:
        default_format: json
    format_listener:
        enabled: true
        rules:
          - { path: '^/api', priorities: ['json', 'xml'], fallback_format: json, prefer_extension: true }
    serializer:
        serialize_null: true
    body_converter:
        enabled: true
</code></pre>

<p>and my HTTP request is the following one:</p>

<pre><code>POST /app_dev_local.php/api/users/admin/globaltoken.json HTTP/1.1
Host: localhost:8000
Cache-Control: no-cache

{
    "password": "&lt;a password&gt;"
}
</code></pre>

<p>this generates an exception like this:</p>

<pre><code>{"error":{"code":415,"message":"Unsupported Media Type","exception":[{"message":"The format \"txt\" is not supported for deserialization.","class":"Symfony\\Component\\HttpKernel\\Exception\\UnsupportedMediaTypeHttpException","trace":[{"namespace":"","short_class":"","class":"","type":"","function":"","file":"\/Users\/Matteo\/Documents\/belka\/auth\/vendor\/friendsofsymfony\/rest-bundle\/FOS\/RestBundle\/Request\/AbstractRequestBodyParamConverter.php","line":121,"args":[]},{"namespace":"FOS\\RestBundle\\Request","short_class":"AbstractRequestBodyParamConverter","class":"FOS\\RestBundle\\Request\\AbstractRequestBodyParamConverter","type":"-&gt;","function":"execute","file":"\/Users\/Matteo\/Documents\/belka\/auth\/vendor\/friendsofsymfony\/rest-bundle\/FOS\/RestBundle\/Request\/RequestBodyParamConverter.php
</code></pre>

<p>where the interesting part is:</p>

<pre><code>"Unsupported Media Type","exception":[{"message":"The format \"txt\"
</code></pre>

<p>so I tried to change my HTTP request like this:</p>

<pre><code>POST /app_dev_local.php/api/users/admin/globaltoken.json HTTP/1.1
Host: localhost:8000
Content-Type: application/json
Cache-Control: no-cache

{
    "password": "&lt;a password&gt;"
}
</code></pre>

<p>and it works! My extension is totally ignored I guess. Is there something wrong with my configuration? Is it because of a <code>JMSSerializer</code> misconfiguration? Here is my annotations:</p>

<pre><code>/**
 * @View()
 *
 * @Route("/users/{username}/globaltoken", requirements={"user"="\w+"})
 * @ParamConverter(
 *     "userBody",
 *     class="Belka\AuthBundle\Entity\User",
 *     converter="fos_rest.request_body",
 *     options={"deserializationContext"={"groups"={"personal"}}}
 * )
 */
public function postAction($username, User $userBody)
</code></pre>