-
Notifications
You must be signed in to change notification settings - Fork 12
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: upgrade Connexion to v3 #249
base: dev
Are you sure you want to change the base?
Conversation
Reviewer's Guide by SourceryThis pull request upgrades Connexion to version 3, refactoring the application to accommodate breaking changes introduced in the new version. Key changes include updating the app creation process to use FlaskApp, refactoring error handling to support new exception types, and modifying CORS setup to use Starlette's middleware. Additionally, example applications and tests have been updated to align with these changes, and dependencies have been revised to reflect the new Connexion version. Sequence diagram for updated error handling flow in Connexion v3sequenceDiagram
participant C as Client
participant A as FlaskApp
participant E as Error Handler
participant S as State Config
C->>A: Make request
A->>S: Get config state
alt Exception occurs
A->>E: Handle exception
E->>S: Get exception config
E-->>A: Return error response
A-->>C: Return formatted error
else No exception
A-->>C: Return normal response
end
Class diagram showing updated exception handling structureclassDiagram
class FlaskApp {
+add_error_handler()
+run()
}
class ExceptionHandler {
+exception_handler_builtin()
+exception_handler_connexion()
+exception_handler_starlette()
}
class CustomException {
+message: str
}
class CustomExceptionConnexion {
+status: int
+title: str
+detail: str
}
class CustomExceptionStarlette {
+status_code: int
+detail: str
}
FlaskApp --> ExceptionHandler
ExceptionHandler --> CustomException
ExceptionHandler --> CustomExceptionConnexion
ExceptionHandler --> CustomExceptionStarlette
note for FlaskApp "Updated to use Connexion v3"
note for ExceptionHandler "New handler structure"
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Description
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
Fixes # (issue)
Type of change
Please delete options that are not relevant.
Checklist:
Summary by Sourcery
Upgrade Connexion to version 3 and refactor the codebase to accommodate breaking changes, including updates to exception handling, database client retrieval, and CORS configuration. Update documentation and tests to align with these changes.
Enhancements:
get_client
for improved code clarity and maintainability.Build:
Documentation:
connexion.request.state.config
instead ofcurrent_app.config.foca
.Tests: