Skip to content

Conversation

@Kwok-he-Chu
Copy link
Member

This PR addresses the changes needed for in this PR and this .NET PR containing the mustache-template changes

@Kwok-he-Chu Kwok-he-Chu requested review from a team as code owners October 28, 2025 16:34
@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 orchestrates a comprehensive upgrade of the OpenAPI Generator templates for both the .NET and Java SDKs to version 7. The changes primarily focus on adapting the build automation scripts to the new template architecture, introducing new services, and refining the code generation process for models, services, and webhook handlers. This ensures that the generated SDKs are compatible with the latest generator features and maintain a consistent, high-quality structure across different languages.

Highlights

  • .NET OpenAPI Generator Upgrade: The .NET OpenAPI Generator has been upgraded to use V7 templates, involving a significant refactor of the dotnet/build.gradle script to align with the new template structure and generation process.
  • Build Automation Enhancements: The buildSrc/src/main/groovy/adyen.sdk-automation-conventions.gradle file has been updated to include new services like SessionAuthentication, BalanceWebhooks, and TokenizationWebhooks. It also introduces logic to rename 'General' tags in small services and add a custom x-webhook-root extension for webhook models, improving the generated code structure.
  • Reserved Word Handling in C#: A new function replaceReservedWords has been added to dotnet/build.gradle to automatically handle C# reserved words, preventing compilation issues in generated code.
  • Refined Deployment Tasks: The deployment tasks in dotnet/build.gradle have been completely revamped to separate the generation and deployment of models, services, clients, extensions, documentation, and webhook handlers, providing more granular control over the build process.
  • Java OpenAPI Generator Updates: The Java build configuration in java/build.gradle has been updated to use V7 templates, remove specific smallServices logic, and integrate webhook handler generation using a dedicated webhook_handler.mustache template.
  • Documentation and Configuration Updates: The README.md has been updated with new gradlew commands for Java and .NET OpenAPI generator versions and local testing. New gradle.properties files have been added for both dotnet and java to specify their respective OpenAPI generator versions, and config.yaml files were updated for webhook generation.
Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/gradle.yml
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.

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 upgrades the OpenAPI generator for .NET to use V7 templates and also includes updates for the Java generator. The changes are extensive, involving modifications to Gradle build scripts to support new generator features, add new services, and improve webhook handling.

My review focuses on improving the maintainability and correctness of the build scripts. I've identified a few issues:

  • In buildSrc/src/main/groovy/adyen.sdk-automation-conventions.gradle, there are redundant imports and a misleading log message that should be corrected.
  • In dotnet/build.gradle, I've pointed out inconsistencies in task naming and grouping that affect clarity, as well as a typo in a println statement.

These suggestions aim to make the build scripts cleaner and easier to understand. Overall, the changes are a good step forward in modernizing the code generation process.

Comment on lines +196 to +197
import groovy.json.JsonSlurper
import groovy.json.JsonOutput

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

These JsonSlurper and JsonOutput imports are redundant as they are already declared at the top of the file (lines 6-7). They can be safely removed.


tasks.named("generate$svc.name") { dependsOn ungroup }
tasks.named("generate$svc.name", GenerateTask) {
println "Generating ${svc.name} Webhooks..."

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This println statement is inside a loop that iterates over all services, but it prints a message suggesting a webhook is being generated for every service. This is misleading and can cause confusion. The message should only be printed for actual webhook services.

        if (svc.webhook) println "Generating ${svc.name} Webhooks..."

group 'deploy'
description "Deploy $svc.name models into the repo."
dependsOn "generate$svc.name"
def deployModels = tasks.register("generate${svc.name}Models", Sync) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The task is named generate${svc.name}Models, but its purpose is to deploy (copy) generated files. This is confusing because there's already a generate${svc.name} task for code generation. For clarity and consistency, deployment tasks should be named with a deploy prefix. The variable name deployModels already suggests this.

This also applies to other similar tasks in this file:

  • generate${svc.name}Services
  • generate${svc.name}Clients
  • generate${svc.name}Extensions
  • generate${svc.name}Documentation
  • generate${svc.name}WebhookHandlers
    def deployModels = tasks.register("deploy${svc.name}Models", Sync) {

// Do not include the `Adyen.{{Webhook}}.Services` as namespace for webhooks.
if (copyDetails.name == 'HostConfiguration.cs' && serviceName.endsWith("Webhooks")) {
copyDetails.file.text = copyDetails.file.text.replace("using Adyen.${serviceName}.Services;", "")
println("Done replacing with ${{serviceName}}")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

There appears to be a typo in the GString interpolation. "${{serviceName}}" creates a closure within the string, which is unnecessary and confusing. It should be simplified to "${serviceName}".

                    println("Done replacing with ${serviceName}")

def deploySmallService = tasks.register("deploy${svc.name}SmallService", Copy) {
def deployExtensions = tasks.register("generate${svc.name}Extensions", Sync) {
println "Moving ${svc.name}-Extensions..."
group "generate"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This task is for deploying generated files, so its group should be deploy for consistency with other deployment tasks in the build script. The current generate group is misleading.

This also applies to the generate${svc.name}Documentation task.

        group "deploy"

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.

2 participants