You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When starting the flask app with gunicorn, the connexion app does not initialize routes. Is there another way to initialize the connexion app while running the flask app with gunicorn?
example:
importloggingfrompathlibimportPathimportconnexionfromconnexion.resolverimportMethodViewResolverlogging.basicConfig(level=logging.INFO)
zoo= {
1: {
"id": 1,
"name": "giraffe",
"tags": ["africa", "yellow", "hoofs", "herbivore", "long neck"],
},
2: {
"id": 2,
"name": "lion",
"tags": ["africa", "yellow", "paws", "carnivore", "mane"],
},
}
app=connexion.FlaskApp(__name__, specification_dir="spec/")
options= {"swagger_ui": True}
app.add_api(
"openapi.yaml",
options=options,
arguments={"title": "MethodViewResolver Example"},
resolver=MethodViewResolver(
"api",
# class params are entirely optional# they allow to inject dependencies top down# so that the app can be wired, in the entrypointclass_arguments={"PetsView": {"kwargs": {"pets": zoo}}},
),
strict_validation=True,
validate_responses=True,
)
# get access to the flask appflask_app=app.appif__name__=="__main__":
app.run(f"{Path(__file__).stem}:app", port=8080)
{
"type": "about:blank",
"title": "Not Found",
"detail": "The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.",
"status": 404
}
Steps to reproduce
run script above
Additional info:
Output of the commands:
python --version
pip show connexion | grep "^Version\:"
The text was updated successfully, but these errors were encountered:
Description
When starting the flask app with gunicorn, the connexion app does not initialize routes. Is there another way to initialize the connexion app while running the flask app with gunicorn?
example:
Then I ran gunicorn
Expected behaviour
http://localhost:8080/openapi/pets
would show pets
Actual behaviour
{
"type": "about:blank",
"title": "Not Found",
"detail": "The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.",
"status": 404
}
Steps to reproduce
run script above
Additional info:
Output of the commands:
python --version
pip show connexion | grep "^Version\:"
The text was updated successfully, but these errors were encountered: