Repository navigation
[foreignexchange] Code generation: update services and models - #2072
AdyenAutomationBot wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
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.
| 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; | ||
| } | ||
| } |
There was a problem hiding this comment.
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) { |
9c40ee6 to
cb486ea
Compare
cb486ea to
9e4535c
Compare
9e4535c to
79a3b11
Compare
|



This PR contains the automated changes for the
foreignexchangeservice.Adyen/adyen-openapi@45520ee
The commit history of this PR reflects the
adyen-openapicommits that have been applied.