Fix swagger UI serving

This commit is contained in:
Sandro Jäckel 2025-07-28 01:09:17 +02:00
parent 30f08304a8
commit 5486497da7
No known key found for this signature in database
GPG Key ID: 3AF5A43A3EECC2E5

View File

@ -1299,7 +1299,9 @@ def create_app(args):
app.jinja_env.globals.update(_e=gettext_escaped, _h=gettext_html)
# Call factory function to create our blueprint
swaggerui_blueprint = get_swaggerui_blueprint(swagger_url, api_url)
# The Blueprint is not using url_for which means the middleware does not work properly and we need to manually fix things
swaggerui_blueprint = get_swaggerui_blueprint(args.url_prefix + swagger_url, args.url_prefix + api_url)
swaggerui_blueprint.url_prefix = swagger_url
app.register_blueprint(swaggerui_blueprint)
return app