You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
animegame/config/packages/fos_rest.yaml

24 lines
962 B

# 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']