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

fix: add connexion 3 support #108

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion json_logging/framework/connexion/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,12 @@ def config(self, app, request_response_dto_class, exclude_url_patterns=[]):

@app.app.before_request
def before_request():
if is_not_match_any_pattern(_current_request.path, exclude_url_patterns):
# for connexion 3.0+, requests use starlette
if hasattr(_current_request, "_starlette_request"):
path = _current_request.url.path
else:
path = _current_request.path
if is_not_match_any_pattern(path, exclude_url_patterns):
g.request_response_data = request_response_dto_class(_current_request)

@app.app.after_request
Expand Down