0

I followed official documentation and this post so I can configure Swagger on my Symfony project.

As I am in my local environment I tried to access: http://localhost:8083/api/doc to see if everything is setup.

The route renders: {"message":"Authentication Required"}

I configured:

  • bundle in bundles.yaml
  • routes in routes.yaml
  • specified areas in nelmio_api_doc.yaml

My routes.yaml file:

app.swagger_ui:
 path: api/doc
  methods: GET
  defaults: { _controller: nelmio_api_doc.controller.swagger_ui }

app.swagger:
  path: api/doc.json
  methods: GET
  defaults: { _controller: nelmio_api_doc.controller.swagger }

Has it something to do with security.yaml file and how I can surpass this message?

security.yaml file:

 access_control:
    - { path: ^/api/doc, roles: IS_AUTHENTICATED_ANONYMOUSLY }
    - { path: ^/api, roles: IS_AUTHENTICATED_FULLY }
bjhonna
  • 11
  • 3

0 Answers0