Skip to content

[foreignexchange] Code generation: update services and models - #2072

Open
AdyenAutomationBot wants to merge 1 commit into
mainfrom
sdk-automation/foreignexchange
Open

AdyenAutomationBot wants to merge 1 commit into
mainfrom
sdk-automation/foreignexchange

Conversation

@AdyenAutomationBot

@AdyenAutomationBot AdyenAutomationBot commented Sep 23, 2026 •

Copy link
Copy Markdown
Collaborator

This PR contains the automated changes for the foreignexchange service.

Adyen/adyen-openapi@45520ee

The commit history of this PR reflects the adyen-openapi commits that have been applied.

@AdyenAutomationBot
AdyenAutomationBot requested a review from a team as a code owner September 23, 2026 15:26

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

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 the generated Java SDK models and service classes for the Foreign Exchange API, including rate calculation requests, responses, and error entities. The review feedback highlights a logic bug in JSON.java where the discriminator resolution incorrectly re-evaluates the parent's discriminator instead of the child's, as well as a missing @OverRide annotation on the equals method in AbstractOpenApiSchema.java.

Comment on lines +144 to +156
if (!discriminatorName.equals(childCdm.discriminatorName)) {
discrValue = getDiscriminatorValue(node);
if (discrValue == null) {
continue;
}
}
if (childCdm != null) {
// Recursively traverse the discriminator mappings.
Class<?> childDiscr = childCdm.getClassForElement(node, visitedClasses);
if (childDiscr != null) {
return childDiscr;
}
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

There is a logic bug in the discriminator resolution when the child schema has a different discriminator name. Calling getDiscriminatorValue(node) without a qualifier invokes the method on this (the parent), which re-evaluates the parent's discriminator instead of the child's. It should be childCdm.getDiscriminatorValue(node). Additionally, the null check if (childCdm != null) is redundant because childCdm == null is already checked and handled above.

        if (!discriminatorName.equals(childCdm.discriminatorName)) {
          discrValue = childCdm.getDiscriminatorValue(node);
          if (discrValue == null) {
            continue;
          }
        }
        // Recursively traverse the discriminator mappings.
        Class<?> childDiscr = childCdm.getClassForElement(node, visitedClasses);
        if (childDiscr != null) {
          return childDiscr;
        }

return o.toString().replace("\n", "\n ");
}

public boolean equals(Object o) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The equals method overrides Object.equals(Object) but is missing the @Override annotation. Adding @Override is a best practice to ensure compile-time safety and clarity.

  @Override
  public boolean equals(Object o) {

@AdyenAutomationBot
AdyenAutomationBot force-pushed the sdk-automation/foreignexchange branch 4 times, most recently from 9c40ee6 to cb486ea Compare October 1, 2026 14:41
@AdyenAutomationBot
AdyenAutomationBot force-pushed the sdk-automation/foreignexchange branch from cb486ea to 9e4535c Compare October 5, 2026 12:35
@AdyenAutomationBot
AdyenAutomationBot force-pushed the sdk-automation/foreignexchange branch from 9e4535c to 79a3b11 Compare October 8, 2026 14:22
@sonarqubecloud

sonarqubecloud Bot commented Oct 8, 2026

Copy link
Copy Markdown

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants