docs icon indicating copy to clipboard operation
docs copied to clipboard

Unable to change the Swagger UI Location

Open comxd opened this issue 7 years ago • 1 comments

@see https://github.com/api-platform/api-platform/issues/635

About the api-platform documentation at: Changing the Swagger UI Location

I got this error for "/" and "/docs" routes: Serialization for the format html is not supported.

#api/config/routes.yaml
swagger_ui:
    path: /docs
    controller: api_platform.swagger.action.ui
# api/config/packages/api_platform.yaml
api_platform:
    # ...
    enable_swagger_ui: false

It's due to the route vendor/api-platform/core/src/Bridge/Symfony/Bundle/Resources/config/routing/docs.xml : /docs.{_format} used for the hydra doc.

For change the Swagger UI location, we need to :

  • Override the /docs.{_format} route
  • or Choose another location of "/docs"

comxd avatar Apr 06 '18 13:04 comxd

Can we have a complete configuration file ?

dimitriacseo avatar Jun 25 '19 14:06 dimitriacseo

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

alanpoulain avatar Sep 13 '22 09:09 alanpoulain