# Read the documentation: https://symfony.com/doc/master/bundles/FOSRestBundle/index.html fos_rest: disable_csrf_role: ROLE_API param_fetcher_listener: true body_listener: true # allowed_methods_listener: true # routing_loader: true view: view_response_listener: force exception: enabled: true exception_controller: 'fos_rest.exception.controller:showAction' codes: 'Symfony\Component\Routing\Exception\ResourceNotFoundException': 404 'Doctrine\ORM\OptimisticLockException': HTTP_CONFLICT messages: 'Symfony\Component\Routing\Exception\ResourceNotFoundException': true format_listener: rules: - { path: ^/api, prefer_extension: true, fallback_format: json, priorities: [ json, xml ] } - { path: ^/, prefer_extension: true, fallback_format: html, priorities: [ html ] } serializer: groups: ['Default']