-
Notifications
You must be signed in to change notification settings - Fork 123
OpenAPIGenerator upgrade to v7.16.0 - [1] Added /Core classes and tests #1207
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
OpenAPIGenerator upgrade to v7.16.0 - [1] Added /Core classes and tests #1207
Conversation
Summary of ChangesHello @Kwok-he-Chu, 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 is the initial phase of a larger effort to upgrade the OpenAPIGenerator to version 7.16.0. It introduces a foundational set of core classes and utilities, significantly restructuring the project to support modern .NET features and improve API interaction. Key changes include a new modular 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
|
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 significant upgrade to the OpenAPIGenerator and adds a new set of core classes, which is a great step forward. The code is generally well-structured. My review focuses on improving idempotency in some new extension methods, ensuring consistency in error handling within JSON converters, and enhancing the correctness and maintainability of the new tests. I've also noted that several test methods are unnecessarily marked as async. A major change is the removal of support for .NET 6.0, .NET Framework 4.6.2, and .NET Standard 2.0, making this a breaking change. The PR description mentions .NET 6.0 is EOL, which is not yet the case, so this should be clarified in the release notes.
Changed test to assert this behavior Add a underscore to Test method names for readability
PR-1 of #1204
Description
This PR introduces the /Core classes needed for the upgrade of the OpenApiGenerator to v7.16.0 used in the Adyen sdk-automation to generate .NET models & services from the Adyen OpenAPI Specifications.
These core classes are required as part of the v7 upgrade in the openapi-generator .mustache templates: They are part of what the open-api-generation-tool outputs as code.
/Authwrap ApiKeys per API/Clientto wrap ApiResponses (in the case of OK, BadRequest etc.)) and helper functions to add metadata to headers.UrlBuilderExtensions.cs-class. The Adyen OpenApi (as of Nov 2025) do not contain the full live-url, and some of these APIs (e.g. Checkout, Pal ...) requires a liveUrlPrefix to go live./Client/Extensionsto provide helper functions to inject all services in your Dependency Injection service container and Retry/Timeouts extension functionality for theHttpClient(which previously handled here)/Convertersto introduce (nullable)DateTimeOnly?and (nullable)DateOnly-fields.Newtonsoft.Json) ByteArrayConverter.cs to the new native (System.Text.Json) ByteArrayConverter, which is used in ByteArrayByte[]deserialization/serialization./Options- contains our classes (previously known as: Environment.cs, and Config.cs)to configure theAdyenOptionsorAdyenEnvironment(Test/Live).Change notes
Added new Core classes
Folder-structure
/Core-folder with the following functionality:/Authcontains classes to add authorization to HttpHeaders./Clientcontains classes that wrap the ApiResponses and help-functionality to construct the LiveUrl (seeUrlBuilderExtensions.cs)/Client/Extensions/contains thePolly-library that allows user to configureTimeouts,RetriesandCircuitBreakers./Converterscontains JsonConverters forDateOnly,DateOnlyNullable,DateTimeandDateTimeNullable/Optionscontains classes to configure theAdyenOptionsorAdyenEnvironment(Test/Live).DateTimeOffSetnew DateTime(2025, 12, 25, 11, 59, 59)new DateTimeOffset(2025, 12, 25, 11, 59, 59, TimeSpan.Zero)DateTimeOnlynew DateTime(2025, 12, 25, 11, 59, 59)new DateOnly(2025, 12, 25)