[legalentitymanagement] Code generation: update services and models#1912
[legalentitymanagement] Code generation: update services and models#1912AdyenAutomationBot wants to merge 1 commit intomainfrom
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the Legal Entity Management SDK by adding the industryCodeDescription field to the BusinessLine, BusinessLineInfo, and BusinessLineInfoUpdate models, and the bic field to IbanAccountIdentification. It also refines documentation for LegalEntityAssociation and Organization. The review feedback identifies that the new @JsonCreator constructors fail to update the isSet flags, which is necessary for correct explicit null serialization. Additionally, the industryCodeDescription field is missing setters and fluent builder methods across several models, and a breaking change was introduced in the BusinessLine constructor.
| public BusinessLine( | ||
| @JsonProperty(JSON_PROPERTY_ID) String id, | ||
| @JsonProperty(JSON_PROPERTY_INDUSTRY_CODE_DESCRIPTION) String industryCodeDescription) { | ||
| this(); | ||
| this.id = id; | ||
| this.industryCodeDescription = industryCodeDescription; | ||
| } |
There was a problem hiding this comment.
The update to the @JsonCreator constructor is a breaking change for users of the SDK who rely on the previous single-parameter constructor. Additionally, the constructor fails to update the isSetId and isSetIndustryCodeDescription flags. These flags are used by getExplicitNulls() to determine which fields should be explicitly serialized as null. Without setting them to true, any values provided via this constructor will be ignored by the explicit null logic, which can cause issues when round-tripping data.
public BusinessLine(
@JsonProperty(JSON_PROPERTY_ID) String id,
@JsonProperty(JSON_PROPERTY_INDUSTRY_CODE_DESCRIPTION) String industryCodeDescription) {
this();
this.id = id;
this.isSetId = true; // mark as set
this.industryCodeDescription = industryCodeDescription;
this.isSetIndustryCodeDescription = true; // mark as set
}| @JsonProperty(JSON_PROPERTY_INDUSTRY_CODE_DESCRIPTION) | ||
| @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) | ||
| public String getIndustryCodeDescription() { | ||
| return industryCodeDescription; | ||
| } |
There was a problem hiding this comment.
The field industryCodeDescription is missing a setter and a fluent builder method. This is inconsistent with other fields in this class (like industryCode) and limits the ability to build or modify the object programmatically, especially since the only way to set this field currently is via the constructor which requires the id as well.
@JsonProperty(JSON_PROPERTY_INDUSTRY_CODE_DESCRIPTION)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getIndustryCodeDescription() {
return industryCodeDescription;
}
/**
* The description of the industry code.
*
* @param industryCodeDescription The description of the industry code.
*/
@JsonProperty(JSON_PROPERTY_INDUSTRY_CODE_DESCRIPTION)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setIndustryCodeDescription(String industryCodeDescription) {
this.industryCodeDescription = industryCodeDescription;
this.isSetIndustryCodeDescription = true; // mark as set
}
/**
* The description of the industry code.
*
* @param industryCodeDescription The description of the industry code.
* @return the current {@code BusinessLine} instance, allowing for method chaining
*/
public BusinessLine industryCodeDescription(String industryCodeDescription) {
this.industryCodeDescription = industryCodeDescription;
this.isSetIndustryCodeDescription = true; // mark as set
return this;
}| public BusinessLineInfo( | ||
| @JsonProperty(JSON_PROPERTY_INDUSTRY_CODE_DESCRIPTION) String industryCodeDescription) { | ||
| this(); | ||
| this.industryCodeDescription = industryCodeDescription; | ||
| } |
There was a problem hiding this comment.
The new @JsonCreator constructor fails to set the isSetIndustryCodeDescription flag to true. This will cause the field to be ignored by the getExplicitNulls() method, preventing explicit null values from being correctly serialized.
| public BusinessLineInfo( | |
| @JsonProperty(JSON_PROPERTY_INDUSTRY_CODE_DESCRIPTION) String industryCodeDescription) { | |
| this(); | |
| this.industryCodeDescription = industryCodeDescription; | |
| } | |
| public BusinessLineInfo( | |
| @JsonProperty(JSON_PROPERTY_INDUSTRY_CODE_DESCRIPTION) String industryCodeDescription) { | |
| this(); | |
| this.industryCodeDescription = industryCodeDescription; | |
| this.isSetIndustryCodeDescription = true; // mark as set | |
| } |
| @JsonProperty(JSON_PROPERTY_INDUSTRY_CODE_DESCRIPTION) | ||
| @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) | ||
| public String getIndustryCodeDescription() { | ||
| return industryCodeDescription; | ||
| } |
There was a problem hiding this comment.
The field industryCodeDescription is missing a setter and a fluent builder method, making it inconsistent with other fields in the model and difficult to use programmatically.
@JsonProperty(JSON_PROPERTY_INDUSTRY_CODE_DESCRIPTION)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getIndustryCodeDescription() {
return industryCodeDescription;
}
/**
* The description of the industry code.
*
* @param industryCodeDescription The description of the industry code.
*/
@JsonProperty(JSON_PROPERTY_INDUSTRY_CODE_DESCRIPTION)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setIndustryCodeDescription(String industryCodeDescription) {
this.industryCodeDescription = industryCodeDescription;
this.isSetIndustryCodeDescription = true; // mark as set
}
/**
* The description of the industry code.
*
* @param industryCodeDescription The description of the industry code.
* @return the current {@code BusinessLineInfo} instance, allowing for method chaining
*/
public BusinessLineInfo industryCodeDescription(String industryCodeDescription) {
this.industryCodeDescription = industryCodeDescription;
this.isSetIndustryCodeDescription = true; // mark as set
return this;
}| public BusinessLineInfoUpdate( | ||
| @JsonProperty(JSON_PROPERTY_INDUSTRY_CODE_DESCRIPTION) String industryCodeDescription) { | ||
| this(); | ||
| this.industryCodeDescription = industryCodeDescription; | ||
| } |
There was a problem hiding this comment.
The new @JsonCreator constructor fails to set the isSetIndustryCodeDescription flag to true. This is particularly important for update models where tracking which fields were explicitly provided is crucial.
| public BusinessLineInfoUpdate( | |
| @JsonProperty(JSON_PROPERTY_INDUSTRY_CODE_DESCRIPTION) String industryCodeDescription) { | |
| this(); | |
| this.industryCodeDescription = industryCodeDescription; | |
| } | |
| public BusinessLineInfoUpdate( | |
| @JsonProperty(JSON_PROPERTY_INDUSTRY_CODE_DESCRIPTION) String industryCodeDescription) { | |
| this(); | |
| this.industryCodeDescription = industryCodeDescription; | |
| this.isSetIndustryCodeDescription = true; // mark as set | |
| } |
| @JsonProperty(JSON_PROPERTY_INDUSTRY_CODE_DESCRIPTION) | ||
| @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) | ||
| public String getIndustryCodeDescription() { | ||
| return industryCodeDescription; | ||
| } |
There was a problem hiding this comment.
Missing setter and fluent method for industryCodeDescription. Since this is an update model, users should be able to set this field easily alongside other updateable fields.
@JsonProperty(JSON_PROPERTY_INDUSTRY_CODE_DESCRIPTION)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getIndustryCodeDescription() {
return industryCodeDescription;
}
/**
* The description of the industry code.
*
* @param industryCodeDescription The description of the industry code.
*/
@JsonProperty(JSON_PROPERTY_INDUSTRY_CODE_DESCRIPTION)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setIndustryCodeDescription(String industryCodeDescription) {
this.industryCodeDescription = industryCodeDescription;
this.isSetIndustryCodeDescription = true; // mark as set
}
/**
* The description of the industry code.
*
* @param industryCodeDescription The description of the industry code.
* @return the current {@code BusinessLineInfoUpdate} instance, allowing for method chaining
*/
public BusinessLineInfoUpdate industryCodeDescription(String industryCodeDescription) {
this.industryCodeDescription = industryCodeDescription;
this.isSetIndustryCodeDescription = true; // mark as set
return this;
}
gcatanese
left a comment
There was a problem hiding this comment.
Verify if the PR introduces breaking changes (as Gemini suggests)
6611fb3 to
a2e2228
Compare
This PR contains the automated changes for the
legalentitymanagementservice.The commit history of this PR reflects the
adyen-openapicommits that have been applied.