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@d449f09

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 2 times, most recently from 9e4535c to 79a3b11 Compare October 8, 2026 14:22
@andrej-gajduk-adyen
andrej-gajduk-adyen removed their request for review October 9, 2026 13:29
@AdyenAutomationBot
AdyenAutomationBot force-pushed the sdk-automation/foreignexchange branch 13 times, most recently from f6742ac to 90d93a3 Compare October 21, 2026 10:04
@AdyenAutomationBot
AdyenAutomationBot force-pushed the sdk-automation/foreignexchange branch 3 times, most recently from d4cf0d6 to 5fbcdad Compare October 28, 2026 13:12
@AdyenAutomationBot
AdyenAutomationBot force-pushed the sdk-automation/foreignexchange branch 3 times, most recently from 13e352e to 498b3b9 Compare November 3, 2026 07:30
@AdyenAutomationBot
AdyenAutomationBot force-pushed the sdk-automation/foreignexchange branch 2 times, most recently from e17cad3 to 5dad108 Compare November 6, 2026 10:34
@AdyenAutomationBot
AdyenAutomationBot force-pushed the sdk-automation/foreignexchange branch from 5dad108 to 0975720 Compare November 9, 2026 15:34
@sonarqubecloud

sonarqubecloud Bot commented Nov 9, 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