Connexion: Swagger UI endpoint can be changed from /ui to something else in connexion 2.x ?

Created on 9 Apr 2019  路  2Comments  路  Source: zalando/connexion

In the 1.x versions of connexion, it was possible to redirect the endpoint where the Swagger UI should expose the API documentation, passing swagger_url when constructing the App object:

connexion.App(__name__,
                        specification_dir='any-dir',
                        swagger_url='docs')

This way, for example, instead of providing the UI on /ui endpoint, the UI is exposed on /docs endpoint.

How to change that endpoint in connexion 2.2.0? I haven't found any option to do that in the documentation, neither an example.

Most helpful comment

See the first dot point under "new in Connexion 2.0" in the readme.

options must be passed in via the options argument.

connexion.App(__name__, options={"swagger_url"="docs"})

All 2 comments

See the first dot point under "new in Connexion 2.0" in the readme.

options must be passed in via the options argument.

connexion.App(__name__, options={"swagger_url"="docs"})

Thanks @dtkav ! It was just that. :)

Was this page helpful?
0 / 5 - 0 ratings