I have the following configuration:
fos_rest:
view:
view_response_listener: 'force'
formats:
json: true
xml: true
html: false
body_listener:
decoders:
json: fos_rest.decoder.json
xml: fos_rest.decoder.xml
body_converter:
enabled: true
format_listener:
enabled: true
rules:
- { path: '^/api', priorities: ['xml', 'json'], fallback_format: xml, prefer_extension: false }
param_fetcher_listener: force
routing_loader:
# default_format: xml
include_format: false
serializer:
serialize_null: true
and the following Controller:
/**
* @Rest\View(serializerGroups={"o-all-getCDashboard"})
*/
public function cgetAction($_format)
{
$handler = $this->getHandler();
die(dump($_format));
return $handler->getAll();
}
within a class that extends FOSRestController implements ClassResourceInterface
which always dumps null
. If I re-enable default_format: xml
what I get is always xml
notwithstanding the Accept
header I send. What's wrong with it? Why does not the format_listener
work?