-
Notifications
You must be signed in to change notification settings - Fork 114
[PlatformsAPIs] Code generation: update services and models #833
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
Summary of ChangesHello @AdyenAutomationBot, 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 primarily focuses on expanding the capabilities of the Adyen platforms by integrating new features for Strong Customer Authentication (SCA) device management and granular control over balance webhook notifications. It also incorporates various model updates and minor code generation refinements across multiple API domains to ensure consistency and introduce new data points. Highlights
Using Gemini Code AssistThe 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 by creating a comment using either
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 Limitations & Feedback Gemini Code Assist 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. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. 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
|
@gemini-code-assist
gemini-code-assist
bot
left a comment
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 a number of new models and services, likely from an OpenAPI generator update. The changes are mostly additions of new classes. My review focuses on a recurring issue in the generated code's validation logic. In several model classes, setters for enum-like properties now use error_log instead of throwing an InvalidArgumentException for invalid values. This is a significant regression as it can lead to objects being in an invalid state without halting execution, making bugs harder to find. I've added comments on all occurrences of this issue in the new and modified files with a suggestion to revert to throwing exceptions for better robustness.
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.
Using error_log for invalid enum values is not recommended. It allows the object to be in an invalid state, which can lead to hard-to-debug issues later. It's safer to throw an InvalidArgumentException to fail fast and immediately signal a programming error.
if (!in_array($status, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( "Invalid value '%s' for 'status', must be one of '%s'", $status, implode("', '", $allowedValues) ) ); }
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.
Using error_log for invalid enum values is not recommended. It allows the object to be in an invalid state, which can lead to hard-to-debug issues later. It's safer to throw an InvalidArgumentException to fail fast and immediately signal a programming error.
if (!in_array($type, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( "Invalid value '%s' for 'type', must be one of '%s'", $type, implode("', '", $allowedValues) ) ); }
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.
Using error_log for invalid enum values is not recommended. It allows the object to be in an invalid state, which can lead to hard-to-debug issues later. It's safer to throw an InvalidArgumentException to fail fast and immediately signal a programming error.
if (!in_array($status, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( "Invalid value '%s' for 'status', must be one of '%s'", $status, implode("', '", $allowedValues) ) ); }
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.
Using error_log for invalid enum values is not recommended. It allows the object to be in an invalid state, which can lead to hard-to-debug issues later. It's safer to throw an InvalidArgumentException to fail fast and immediately signal a programming error.
if (!in_array($type, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( "Invalid value '%s' for 'type', must be one of '%s'", $type, implode("', '", $allowedValues) ) ); }
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.
Using error_log for invalid enum values is not recommended. It allows the object to be in an invalid state, which can lead to hard-to-debug issues later. It's safer to throw an InvalidArgumentException to fail fast and immediately signal a programming error.
if (!in_array($balanceType, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( "Invalid value '%s' for 'balanceType', must be one of '%s'", $balanceType, implode("', '", $allowedValues) ) ); }
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.
Using error_log for invalid enum values is not recommended. It allows the object to be in an invalid state, which can lead to hard-to-debug issues later. It's safer to throw an InvalidArgumentException to fail fast and immediately signal a programming error.
if (!in_array($conditionType, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( "Invalid value '%s' for 'conditionType', must be one of '%s'", $conditionType, implode("', '", $allowedValues) ) ); }
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.
Using error_log for invalid enum values is not recommended. It allows the object to be in an invalid state, which can lead to hard-to-debug issues later. It's safer to throw an InvalidArgumentException to fail fast and immediately signal a programming error.
if (!in_array($type, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( "Invalid value '%s' for 'type', must be one of '%s'", $type, implode("', '", $allowedValues) ) ); }
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.
Using error_log for invalid enum values is not recommended. It allows the object to be in an invalid state, which can lead to hard-to-debug issues later. It's safer to throw an InvalidArgumentException to fail fast and immediately signal a programming error.
if (!in_array($type, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( "Invalid value '%s' for 'type', must be one of '%s'", $type, implode("', '", $allowedValues) ) ); }
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.
Using error_log for invalid enum values is not recommended. It allows the object to be in an invalid state, which can lead to hard-to-debug issues later. It's safer to throw an InvalidArgumentException to fail fast and immediately signal a programming error.
if (!in_array($result, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( "Invalid value '%s' for 'result', must be one of '%s'", $result, implode("', '", $allowedValues) ) ); }
Quality Gate Passed Quality Gate passed
Issues
111 New issues
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
88.3% Duplication on New Code
OpenAPI spec files or templates have been modified on 22-10-2025 by commit.