Conversation
Summary of ChangesHello @galesky-a, 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 refines the build process for the .NET SDK by introducing several automation steps. It ensures a consistent OpenAPI specification version is used, proactively removes problematic discriminator schemas that might cause issues during .NET code generation, and enhances the robustness of enum serialization in the generated C# models by applying a safer converter. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Ignored Files
Activity
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.
Code Review
This pull request updates the build process for the dotnet project. It pins the OpenAPI specification to a specific commit, adds a new task to remove schemas with discriminators before code generation for dotnet, and adds another post-processing task to replace StringEnumConverter. My review focuses on potential issues with future dates in the git commands, improving the robustness of a new task, and making a regex more resilient. Overall, the changes are logical, but a few adjustments are recommended for correctness and maintainability.
build.gradle
Outdated
| group 'setup' | ||
| description 'Clone OpenAPI spec (and apply local patches).' | ||
| commandLine 'git', 'clone', '--depth', '2', uri, specsDir | ||
| commandLine 'git', 'clone', '--shallow-since=2025-10-23', uri, specsDir |
| doLast { | ||
| exec { | ||
| workingDir specsDir | ||
| commandLine 'git', 'checkout', 'a9d350f' // same date as .NET 32.1.3 , --before="2025-09-11 15:56:38 +0200" |
| if (newFound.isEmpty()) break | ||
| schemasToRemove.addAll(newFound) | ||
| iteration++ | ||
| if (iteration > 10) break // Safety limit |
There was a problem hiding this comment.
The safety limit of 10 iterations is a good defensive measure. However, if this limit is reached, the loop will break silently. This could lead to an incomplete removal of schemas, which might be hard to debug. Consider logging a warning if the iteration limit is exceeded to make such a situation more visible.
if (iteration > 10) {
println "WARNING: Schema removal for ${svc.name} for dotnet exceeded 10 iterations. The list of removed schemas may be incomplete."
break // Safety limit
}
| /\[JsonConverter\(typeof\(StringEnumConverter\)\)\]/, | ||
| '[JsonConverter(typeof(Adyen.Util.SafeStringEnumConverter))]' |
There was a problem hiding this comment.
The regular expression used to find [JsonConverter(typeof(StringEnumConverter))] is quite specific and might break if there are any variations in whitespace, for example, if a code formatter is run on the generated files. Using a more flexible regex that allows for optional whitespace would make this script more robust.
/^\[\s*JsonConverter\s*\(\s*typeof\s*\(\s*StringEnumConverter\s*\)\s*\)\s*\]$/,
'[JsonConverter(typeof(Adyen.Util.SafeStringEnumConverter))]'
a527802 to
40e7d21
Compare
Description
This PR introduces a "graceful fail" mechanism for enum deserialization. It ensures that when the Adyen API adds new enum values, the SDK remains functional by treating unknown values as null rather than throwing a JsonSerializationException.
Related PRs and runs:
oneOf,allOf). Note that the only change from31.1.3is that LEM was bumped from V3 to V4.Key Changes
Testing Infrastructure:
How to verify