docs
docs copied to clipboard
use for ex "/api_doc" instead "/doc" for path
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.
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: ~
Superseded by https://github.com/api-platform/docs/pull/1604.