build: add support for Connexion 3+
Description
I am making this PR to perform all checks on changes, although I have tested locally.
I have made only the necessary changes. I will be writing a summary for the migration of connexion 2.14 to 3 and then request for reviews.
Fixes #188
Type of change
- [x] Breaking change (fix or feature that would cause existing functionality to not work as expected)
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Comparison is base (
0d21a08) 100.00% compared to head (9662b33) 100.00%.
Additional details and impacted files
@@ Coverage Diff @@
## dev #204 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 20 20
Lines 975 974 -1
=========================================
- Hits 975 974 -1
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Apologies for the delay, @uniqueg.
Summary:
- In connexion 2 we were using
Appwhich is of typeFlaskinstance of connexion, while in connexion 3 they changed the type ofAppinstance toFlaskAppwhich is their custom class. - Directly providing the configuration is not possible anymore (example- link). If you will try to provide any parameter to
app.configfollowing error will be thrown:AttributeError: 'FlaskApp' object has no attribute 'config'. - Installing
connexion==3.0.1did not work for me, I had to installconnexion[flask]andconnexion[uvicorn]to make it work, as connexion 3 is based on the ASGI server. (Throws:ModuleNotFoundError: Please install connexion using the 'flask' extra) - One minor change is that
skip error handlersis also deprecated in connexion 3. (link) - I am not sure about how to configure parameters like host, port of a
uvicornapp while initializing it (connexion 3 run), but I just stored them inapp.app.config(link) and used them at runtime (link). - The major error I faced was that I was unable to
add pet,TypeError: addPet() missing 1 required positional argument: 'pet', that's why I changedopen-apispec, which is not ideal. (link)
I will keep adding new points whenever I will encounter some error.
Closed in favor of #249