Annotate your controller action with @View
to resolve this issue.
use FOS\RestBundle\View\View;
Have a look at the documentation chapter View Response listener.
If you don't want to annotate every action - you can set the @View annotation for a complete class using my pull request here.
Add this to your composer.json to use the PR.
"require": {
"friendsofsymfony/rest-bundle": "dev-dev-view-addition as 0.12.0",
// ...
"repositories": [
{
"type": "vcs",
"url": "https://github.com/nifr/FOSRestBundle"
},