Skip to content
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

build: add support for Connexion 3+ #204

Draft
wants to merge 3 commits into
base: dev
Choose a base branch
from
Draft

build: add support for Connexion 3+ #204

wants to merge 3 commits into from

Conversation

Rahuljagwani
Copy link
Contributor

@Rahuljagwani Rahuljagwani commented Feb 16, 2024

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

  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Copy link

codecov bot commented Feb 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

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     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Rahuljagwani Rahuljagwani deleted the connexion branch February 16, 2024 20:42
@Rahuljagwani Rahuljagwani restored the connexion branch February 19, 2024 15:42
@Rahuljagwani Rahuljagwani reopened this Feb 21, 2024
@Rahuljagwani Rahuljagwani marked this pull request as draft February 21, 2024 17:40
@Rahuljagwani
Copy link
Contributor Author

Rahuljagwani commented Feb 21, 2024

Apologies for the delay, @uniqueg.

Summary:

  • In connexion 2 we were using App which is of type Flask instance of connexion, while in connexion 3 they changed the type of App instance to FlaskApp which is their custom class.
  • Directly providing the configuration is not possible anymore (example- link). If you will try to provide any parameter to app.config following error will be thrown: AttributeError: 'FlaskApp' object has no attribute 'config'.
  • Installing connexion==3.0.1 did not work for me, I had to install connexion[flask] and connexion[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 handlers is also deprecated in connexion 3. (link)
  • I am not sure about how to configure parameters like host, port of a uvicorn app while initializing it (connexion 3 run), but I just stored them in app.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 changed open-api spec, which is not ideal. (link)

I will keep adding new points whenever I will encounter some error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

build: add support for Connexion 3+
1 participant