docs icon indicating copy to clipboard operation
docs copied to clipboard

use for ex "/api_doc" instead "/doc" for path

Open msitruk opened this issue 7 years ago • 1 comments

In case you need to "Manually Registering the Swagger UI Controller", use another path than "/doc" because that make conflict with Symfony and produce a "Serialization for the format html is not supported." error.

msitruk avatar Oct 11 '18 08:10 msitruk

In my case I use /docs/, note the trailing slash.

routes.yaml:

swagger_ui:
    path: /docs/
    controller: api_platform.swagger.action.ui

If you need to restrict access to the /docs/ path:

security.yaml:

firewalls:
        ...
        docs:
            pattern:    ^/docs/
            http_basic: ~

comxd avatar Nov 13 '18 16:11 comxd

Superseded by https://github.com/api-platform/docs/pull/1604.

alanpoulain avatar Sep 13 '22 09:09 alanpoulain