Skip to content

Conversation

@Kwok-he-Chu
Copy link
Member

@Kwok-he-Chu Kwok-he-Chu commented Nov 18, 2025

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.

  • /Auth wrap ApiKeys per API

  • /Client to wrap ApiResponses (in the case of OK, BadRequest etc.)) and helper functions to add metadata to headers.

  • /Client/Extensions to provide helper functions to inject all services in your Dependency Injection service container and Retry/Timeouts extension functionality for the HttpClient (which previously handled here)

  • /Converters to introduce (nullable) DateTimeOnly? and (nullable) DateOnly-fields.

    • As part of these converters, I had to also port our existing (Newtonsoft.Json) ByteArrayConverter.cs to the new native (System.Text.Json) ByteArrayConverter, which is used in ByteArray Byte[] deserialization/serialization.
  • /Options - contains our classes (previously known as: Environment.cs, and Config.cs)to configure the AdyenOptions or AdyenEnvironment (Test/Live).


Change notes

Added new Core classes

Folder-structure

  • Introduced a /Core-folder with the following functionality:
    • /Auth contains classes to add authorization to HttpHeaders.
    • /Client contains classes that wrap the ApiResponses and help-functionality to construct the LiveUrl (see UrlBuilderExtensions.cs)
    • /Client/Extensions/ contains the Polly-library that allows user to configure Timeouts, Retries and CircuitBreakers.
    • /Converters contains JsonConverters for DateOnly, DateOnlyNullable, DateTime and DateTimeNullable
    • /Options contains classes to configure the AdyenOptions or AdyenEnvironment (Test/Live).
  • All APIs are now part of their own sub-folders
  • Support DateTimeOffSet
    • Before: new DateTime(2025, 12, 25, 11, 59, 59)
    • -> After: new DateTimeOffset(2025, 12, 25, 11, 59, 59, TimeSpan.Zero)
  • Support DateTimeOnly
    • Before: new DateTime(2025, 12, 25, 11, 59, 59)
    • -> After: new DateOnly(2025, 12, 25)
  • Added Polly-library support for optional retries & circuitbreakers
  • Added tests in /Core
  • Use .NET8.0, and removed .NET6.0 as it has reached end-of-life support

@Kwok-he-Chu Kwok-he-Chu self-assigned this Nov 18, 2025
@Kwok-he-Chu Kwok-he-Chu requested review from a team as code owners November 18, 2025 15:40
@gemini-code-assist
Copy link

Summary of Changes

Hello @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 /Core directory, advanced HTTP client resilience policies via Polly, refined date/time serialization, and an update to the .NET 8.0 framework.

Highlights

  • OpenAPIGenerator Upgrade: Introduced new /Core classes to facilitate the upgrade of the OpenAPIGenerator to v7.16.0, which is used for generating .NET models and services from Adyen OpenAPI Specifications.
  • New Core Folder Structure: A new /Core folder has been added, containing sub-folders for /Auth (authorization), /Client (API responses, URL building, Polly integration), /Converters (JSON converters for various date/time types and byte arrays), and /Options (Adyen configuration).
  • Enhanced Date/Time Handling: Added support for DateTimeOffset and DateOnly types, including dedicated JSON converters for both nullable and non-nullable versions, improving date and time serialization/deserialization.
  • Resilience with Polly: Integrated the Polly library within /Client/Extensions/ to allow configuration of Timeouts, Retries, and CircuitBreakers for HTTP client requests, enhancing API call resilience.
  • .NET Framework Update: The project now exclusively targets .NET 8.0, removing support for .NET 6.0, which has reached its end-of-life.
  • API Structure and Utilities: APIs are now organized into their own sub-folders, and new utilities like HmacValidatorUtility for webhook signature validation and UrlBuilderExtensions for constructing live URLs have been added.
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 by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

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 pull request 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 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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@Kwok-he-Chu Kwok-he-Chu changed the title Added /Core classes as part of the OpenAPIGenerator upgrade to v7.16.0 OpenAPIGenerator upgrade to v7.16.0 - Added /Core classes and tests Nov 18, 2025
Copy link

@gemini-code-assist gemini-code-assist bot left a 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.

@Kwok-he-Chu Kwok-he-Chu changed the title OpenAPIGenerator upgrade to v7.16.0 - Added /Core classes and tests OpenAPIGenerator upgrade to v7.16.0 - [1] Added /Core classes and tests Nov 18, 2025
@Kwok-he-Chu Kwok-he-Chu changed the base branch from main to v7-generator/development-branch November 26, 2025 15:50
Changed test to assert this behavior
Add a underscore to Test method names for readability
@Kwok-he-Chu Kwok-he-Chu merged commit 1fce054 into v7-generator/development-branch Nov 28, 2025
@Kwok-he-Chu Kwok-he-Chu deleted the v7-generator/1-add-core-classes branch November 28, 2025 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants