-
Notifications
You must be signed in to change notification settings - Fork 75
OpenAPI Generator v7: Webhooks #1512
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary of Changes
Hello @gcatanese, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request implements a significant refactoring of the webhook handling logic by migrating from centralized handlers to auto-generated, specific handlers for different webhook categories. This change, driven by OpenAPI Generator v7, involves deprecating the old BankingWebhookHandler
and ManagementWebhookHandler
, introducing new dedicated handler classes, updating numerous model typings, and adding new models. The test suite has been adjusted to validate the new structure and deserialization logic. This represents a breaking change for users of the old centralized handlers.
Highlights
- Webhook Handler Refactor: Migrated from centralized
BankingWebhookHandler
andManagementWebhookHandler
to auto-generated, specific handlers for different webhook categories. - New Specific Handlers: Introduced new handlers for ACS, Balance, Configuration, Dispute, Report, Transaction, and Transfer webhooks, generated by OpenAPI Generator v7.
- Deprecated Centralized Handlers: The old
BankingWebhookHandler
andManagementWebhookHandler
classes and their methods have been marked as deprecated. - Updated Model Typings: Numerous model typings across various webhook categories have been updated, including changes to type mapping, constructors, and handling of nullable types.
- New Models Added: Added new models related to Configuration (e.g.,
Device
,NetworkTokenNotificationDataV2
,Wallet
) and Transfer webhooks (e.g.,TransferData
,TransferEvent
, various identification types). - Test Suite Updates: Added new test files for the specific webhook handlers and updated existing tests to use the new handler structure.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command>
or @gemini-code-assist <command>
. Below is a summary of the supported commands.
Feature | Command | Description |
---|---|---|
Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/
folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configureGemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
The pull request successfully introduces generated webhook models and dedicated handlers for various webhook types (ACS, Balance, Configuration, Dispute, Management, Negative Balance Warning, Report, and Transfer), effectively deprecating the previous centralized BankingWebhookHandler
and ManagementWebhookHandler
. New tests for the specific handlers have been added, improving test coverage and clarity. There are a few areas for improvement related to test naming, handling of specific webhook types in generic handlers, and minor stylistic points.
/gemini review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces significant improvements by migrating to version 7 of the OpenAPI generator for webhook models and implementing dedicated handlers for each webhook category. This deprecates the previous centralized webhook handlers, enhancing modularity and type safety. The tests have been updated accordingly, and new tests for the generated webhook handlers and models have been added.
Key changes include:
- Generation of new webhook models and specific handlers (e.g.,
AcsWebhooksHandler
,ConfigurationWebhooksHandler
). - Deprecation of
BankingWebhookHandler
andManagementWebhookHandler
with clear guidance towards new handlers. - Updates to the
ObjectSerializer
to be more robust, including better discriminator handling and date/time format support. - Model property types have been refined (e.g.,
Type | null
changed toType
), and enum member names are more descriptive.
Overall, these changes improve the maintainability and correctness of webhook processing. A couple of areas for minor improvement have been noted, particularly regarding a specific type-checking mechanism in the ACS webhook handler and a test description.
3728c4f
to
5096154
Compare
|
Generate all webhook models
Automate the generation of Webhook events (deprecating the previous approach, i.e. centralised Webhook handler)
Adjust tests
Breaking change: centralised Webhook handlers (
bankingWebhookHandler
,managementWebhookHandler
) are deprecated but it should no longer be used.