-
Notifications
You must be signed in to change notification settings - Fork 6
Upgrade .NET Openapi Generator to V7 Templates #68
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
base: main
Are you sure you want to change the base?
Conversation
Move folders extensions, clients, models and services based on API
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 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
Ignored Files
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 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 aprintlnstatement.
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.
| import groovy.json.JsonSlurper | ||
| import groovy.json.JsonOutput |
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.
|
|
||
| tasks.named("generate$svc.name") { dependsOn ungroup } | ||
| tasks.named("generate$svc.name", GenerateTask) { | ||
| println "Generating ${svc.name} Webhooks..." |
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.
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) { |
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.
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}Servicesgenerate${svc.name}Clientsgenerate${svc.name}Extensionsgenerate${svc.name}Documentationgenerate${svc.name}WebhookHandlers
def deployModels = tasks.register("deploy${svc.name}Models", Sync) {
dotnet/build.gradle
Outdated
| // 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}}") |
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.
| 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" |
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.
This PR addresses the changes needed for in this PR and this .NET PR containing the mustache-template changes