the previous version works well when the api is exposed in the root url "https://myapi.com/"
but not when the api is exposed by apache in a different path like "https://myhost.com/api/". In this case, the '/api/' prefix is configured by apache, and it is not affected by the url_prefix of get_swagger_blueprint(url_prefix="").
In order to fix both cases, flask.url_for() can be used to always get the correct path to the /api-docs endpoint.
Running in apache mod_wsgi:
In order to fix both cases, flask.url_for() can be used to always get the correct path to the /api-docs endpoint.