-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[python] bug cant run vanilla shipped Petstore python-flask generated code #12278
Comments
I am facing the same issue |
connexion 3.0+ no longer has connexion.apps.flask_app, and actually do we even need a JSONEncoder class at all with python3? |
6 tasks
My workaround: OpenAPITools/openapi-generator#17063 (comment) |
Still an issue on 13 Feb 2024. Thankyou so much for posting your suggested fix @rlinke ! |
tommanis1
added a commit
to JorritHK/kb-indexer-cloud
that referenced
this issue
Feb 18, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
The default python-server generated code does not work out of the box.
When running the code against a fresh install environment, the server cannot be started, instead we get "ModuleNotFoundError: No module named 'connexion.apps.flask_app'". This happens to the default Petstore example.
Swagger-codegen version
default Petstore OAS 3.0 example from swagger editor website (see below)
Swagger declaration file content or url
default Petstore OAS 3.0 example from swagger editor website (see below)
Command line used for generation
generation through website
Steps to reproduce
Related issues/PRs
I checked through search but didnt find any related issues/PR.
Suggest a fix/enhancement
It seems there are breaking changes in connexion from 2 to 3, which are currently not considered by python-flask server generation.
Simple workaround is making sure to use version 2 instead of version 3 in the requirements.txt
requirements.txt, I think this here:
swagger-codegen/modules/swagger-codegen/src/main/resources/flaskConnexion/requirements.mustache
Line 1 in 953805c
from:
connexion >= 2.6.0
connexion[swagger-ui] >= 2.6.0
to:
connexion>=2, <3
connexion[swagger-ui]>=2, <3
fixes the issue for me.
Here with python 3.9 and fixed requirements.txt
The text was updated successfully, but these errors were encountered: