# Read the documentation: https://symfony.com/doc/master/bundles/FOSRestBundle/index.html
fos_rest:
  #    param_fetcher_listener:  true
  #    allowed_methods_listener:  true
  #    routing_loader: true
  #    view:
  #        view_response_listener:  true
  #    exception:
  #         codes:
  #    messages:
  #         App\Exception\MyException: Forbidden area.
  #    format_listener:
  #        rules:
  #            - { path: ^/api, prefer_extension: true, fallback_format: json, priorities: [ json, html ] }
  view:
    view_response_listener: true
  format_listener:
    rules:
      - { path: ^/api/doc, prefer_extension: false, fallback_format: html, priorities: [ 'html', '*/*' ] }
      - { path: ^/api, prefer_extension: false, fallback_format: json, priorities: [ json ] }
      - { path: ^/, prefer_extension: false, fallback_format: html, priorities: [ 'html', '*/*' ] }
  serializer:
    serialize_null: true
  exception:
    enabled: true
    messages:
      Symfony\Component\HttpKernel\Exception\BadRequestHttpException: true
      Symfony\Component\HttpKernel\Exception\NotFoundHttpException: true
      Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException: true
      Symfony\Component\HttpKernel\Exception\UnauthorizedHttpException: true
      IService\Bundle\Exception\Validation\ValidationException: true