diff --git a/connexion/apps/flask.py b/connexion/apps/flask.py index 1bb1e229b..a584c344b 100644 --- a/connexion/apps/flask.py +++ b/connexion/apps/flask.py @@ -79,7 +79,7 @@ def _set_base_path(self, base_path: t.Optional[str] = None) -> None: self._set_blueprint() def _set_blueprint(self): - endpoint = flask_utils.flaskify_endpoint(self.base_path) + endpoint = flask_utils.flaskify_endpoint(self.base_path) or "/" self.blueprint = flask.Blueprint( endpoint, __name__, diff --git a/tests/test_api.py b/tests/test_api.py index 998f8ee71..4c9a40887 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -39,7 +39,7 @@ def test_api(): def test_api_base_path_slash(): api = FlaskApi(TEST_FOLDER / "fixtures/simple/basepath-slash.yaml") - assert api.blueprint.name == "" + assert api.blueprint.name == "/" assert api.blueprint.url_prefix == ""