From 0cd68bf277ff69a0fe2a183ec875ed76edd4f610 Mon Sep 17 00:00:00 2001 From: Aaron Holmes Date: Tue, 19 Nov 2024 15:41:44 -0800 Subject: [PATCH] Make FlaskApp instances honor Swagger UI configuration. Closes #161 --- src/web/Ligare/web/application.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/web/Ligare/web/application.py b/src/web/Ligare/web/application.py index 87d4f2cc..173cb37b 100644 --- a/src/web/Ligare/web/application.py +++ b/src/web/Ligare/web/application.py @@ -16,6 +16,7 @@ import json_logging from connexion import FlaskApp +from connexion.options import SwaggerUIOptions from flask import Blueprint, Flask from flask_injector import FlaskInjector from injector import Module @@ -509,8 +510,11 @@ def configure_openapi(config: Config, name: Optional[str] = None): connexion_app = FlaskApp( config.flask.app_name, specification_dir=exec_dir, - # host=host, - # port=port, + swagger_ui_options=SwaggerUIOptions( + swagger_ui=config.flask.openapi.use_swagger, + swagger_ui_path=config.flask.openapi.swagger_url + or SwaggerUIOptions.swagger_ui_path, + ), ) app = connexion_app.app config.update_flask_config(app.config)