Skip to content

[management] Code generation: update services and models - #2067

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

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

Conversation

@AdyenAutomationBot

@AdyenAutomationBot AdyenAutomationBot commented Sep 23, 2026 •

Copy link
Copy Markdown
Collaborator

This PR contains the automated changes for the management 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 12:28

@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 several new models and API services to support terminal theme management and client certificate generation, while also updating existing payment method models with new fields and documentation. I have identified a high-severity issue regarding incorrect equality and hash code implementation for the List<byte[]> field in ClientCertificateWithChain and a medium-severity inconsistency where the name field in ThemeUpdateRequest is typed as Object instead of String. Please address these concerns to ensure correct object comparison and type consistency across the SDK.

Comment on lines +288 to +322
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ClientCertificateWithChain clientCertificateWithChain = (ClientCertificateWithChain) o;
return Objects.equals(this.caChain, clientCertificateWithChain.caChain)
&& Objects.equals(this.isSetCaChain, clientCertificateWithChain.isSetCaChain)
&& Objects.equals(this.id, clientCertificateWithChain.id)
&& Objects.equals(this.isSetId, clientCertificateWithChain.isSetId)
&& Arrays.equals(this.leaf, clientCertificateWithChain.leaf)
&& Objects.equals(this.isSetLeaf, clientCertificateWithChain.isSetLeaf)
&& Objects.equals(this.serialNumber, clientCertificateWithChain.serialNumber)
&& Objects.equals(this.isSetSerialNumber, clientCertificateWithChain.isSetSerialNumber)
&& Objects.equals(this.subjectDN, clientCertificateWithChain.subjectDN)
&& Objects.equals(this.isSetSubjectDN, clientCertificateWithChain.isSetSubjectDN);
}

@Override
public int hashCode() {
return Objects.hash(
caChain,
isSetCaChain,
id,
isSetId,
Arrays.hashCode(leaf),
isSetLeaf,
serialNumber,
isSetSerialNumber,
subjectDN,
isSetSubjectDN);
}

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

The caChain field is of type List<byte[]>. In Java, calling Objects.equals() on a List compares its elements using their equals() method. For byte[] arrays, equals() performs reference equality (==) rather than content equality. This means two ClientCertificateWithChain instances with identical certificate chains (same byte values but different array instances) will be considered unequal.

Similarly, Objects.hash(caChain) computes the hash code using the default identity hash codes of the byte[] elements, leading to inconsistent hash codes for identical content.

To fix this, we should implement custom helper methods to compare and hash the list of byte arrays by content.

  private boolean equalCaChains(List<byte[]> list1, List<byte[]> list2) {
    if (list1 == list2) {
      return true;
    }
    if (list1 == null || list2 == null) {
      return false;
    }
    if (list1.size() != list2.size()) {
      return false;
    }
    for (int i = 0; i < list1.size(); i++) {
      if (!Arrays.equals(list1.get(i), list2.get(i))) {
        return false;
      }
    }
    return true;
  }

  private int hashCodeCaChain(List<byte[]> list) {
    if (list == null) {
      return 0;
    }
    int result = 1;
    for (byte[] element : list) {
      result = 31 * result + Arrays.hashCode(element);
    }
    return result;
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    ClientCertificateWithChain clientCertificateWithChain = (ClientCertificateWithChain) o;
    return equalCaChains(this.caChain, clientCertificateWithChain.caChain)
        && Objects.equals(this.isSetCaChain, clientCertificateWithChain.isSetCaChain)
        && Objects.equals(this.id, clientCertificateWithChain.id)
        && Objects.equals(this.isSetId, clientCertificateWithChain.isSetId)
        && Arrays.equals(this.leaf, clientCertificateWithChain.leaf)
        && Objects.equals(this.isSetLeaf, clientCertificateWithChain.isSetLeaf)
        && Objects.equals(this.serialNumber, clientCertificateWithChain.serialNumber)
        && Objects.equals(this.isSetSerialNumber, clientCertificateWithChain.isSetSerialNumber)
        && Objects.equals(this.subjectDN, clientCertificateWithChain.subjectDN)
        && Objects.equals(this.isSetSubjectDN, clientCertificateWithChain.isSetSubjectDN);
  }

  @Override
  public int hashCode() {
    return Objects.hash(
        hashCodeCaChain(caChain),
        isSetCaChain,
        id,
        isSetId,
        Arrays.hashCode(leaf),
        isSetLeaf,
        serialNumber,
        isSetSerialNumber,
        subjectDN,
        isSetSubjectDN);
  }

Comment on lines +76 to +77
public static final String JSON_PROPERTY_NAME = "name";
private Object name;

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 name field in ThemeUpdateRequest is defined as Object, whereas in all other theme-related models (CreateThemeRequest, ThemeSummary, ThemeWithAssetDetails, UpdateThemeResponse), it is typed as String. This inconsistency reduces type safety and makes the SDK harder to use. Consider updating the OpenAPI specification or generator configuration to ensure name is consistently typed as String.

@AdyenAutomationBot
AdyenAutomationBot force-pushed the sdk-automation/management branch 5 times, most recently from 45a0cd1 to 8e16dc7 Compare September 28, 2026 10:18
@AdyenAutomationBot
AdyenAutomationBot force-pushed the sdk-automation/management branch 3 times, most recently from 94e0aed to 5c9bb3f Compare October 1, 2026 14:42
@andrej-gajduk-adyen
andrej-gajduk-adyen removed their request for review October 5, 2026 11:29
@AdyenAutomationBot
AdyenAutomationBot force-pushed the sdk-automation/management branch 2 times, most recently from 255ff4d to b15e538 Compare October 8, 2026 14:22
@poojah-adyen poojah-adyen added Breaking change Indicates a change that has caused a major version update Don't Merge Don't merge yet for whatever reason labels Oct 13, 2026
@AdyenAutomationBot
AdyenAutomationBot force-pushed the sdk-automation/management branch 12 times, most recently from 46d0d76 to 95cf1fe Compare October 21, 2026 10:04
@AdyenAutomationBot
AdyenAutomationBot force-pushed the sdk-automation/management branch 2 times, most recently from 63dd7f1 to 53183b9 Compare October 22, 2026 14:19
@AdyenAutomationBot
AdyenAutomationBot force-pushed the sdk-automation/management branch 4 times, most recently from dd6847e to 4f84e93 Compare November 3, 2026 07:30
@AdyenAutomationBot
AdyenAutomationBot force-pushed the sdk-automation/management branch 2 times, most recently from 5446f47 to 2b91e29 Compare November 6, 2026 10:35
@sonarqubecloud

sonarqubecloud Bot commented Nov 6, 2026

Copy link
Copy Markdown

@AdyenAutomationBot
AdyenAutomationBot force-pushed the sdk-automation/management branch from 2b91e29 to fc6f5ae Compare November 9, 2026 15:34

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

Labels

Breaking change Indicates a change that has caused a major version update Don't Merge Don't merge yet for whatever reason

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants