Skip to content

Properly setup bundled swagger-ui in Connexion #36975

@Taragolis

Description

@Taragolis

Body

Initially reported in Slack

Hi. I just upgraded to 2.8.1 and am wondering if this is a new warning message:

[2024-01-23T15:02:27.020+0000] {options.py:83} WARNING - The swagger_ui directory could not be found.
    Please install connexion with extra install: pip install connexion[swagger-ui]
    or provide the path to your local installation by passing swagger_path=<your path>

This warning message might comes from the different places:

FAB Auth Manager

options={
"swagger_ui": conf.getboolean("webserver", "enable_swagger_ui", fallback=True),
},

Internal API

options={"swagger_ui": conf.getboolean("webserver", "enable_swagger_ui", fallback=True)},


The nature of this warning that we use bundled to Airflow swagger ui (added in #28788) that mean we do not require connexion[swagger-ui] however for proper work we need to setup swagger_path in Connexion 2.x options by the same way as it done in regular REST API:

options={
"swagger_ui": conf.getboolean("webserver", "enable_swagger_ui", fallback=True),
"swagger_path": os.fspath(ROOT_APP_DIR.joinpath("www", "static", "dist", "swagger-ui")),
},

Or disable swagger by provide swagger_ui=False if this components do not use swagger, unfortunetly I'm not confident about it.

In addition parameters names/types changed in Connexion 3, see: https://connexion.readthedocs.io/en/3.0.5/swagger_ui.html, so better to take it in account into the #36052 or similar PRs

Committer

  • I acknowledge that I am a maintainer/committer of the Apache Airflow project.

Metadata

Metadata

Assignees

No one assigned

    Labels

    AIP-44Airflow Internal APIarea:APIAirflow's REST/HTTP APIkind:metaHigh-level information important to the community

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions