Skip to content

[payment] Code generation: update services and models#1714

Merged
gcatanese merged 1 commit into
mainfrom
sdk-automation/payment
May 21, 2026
Merged

[payment] Code generation: update services and models#1714
gcatanese merged 1 commit into
mainfrom
sdk-automation/payment

Conversation

@AdyenAutomationBot
Copy link
Copy Markdown
Collaborator

This PR contains the automated changes for the payment service.

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 May 21, 2026 12:55
Copy link
Copy Markdown
Contributor

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

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 updates several payment model files to improve the handling of unknown enum values during serialization and deserialization, ensuring raw values are preserved when a predefined match is missing. Across all modified models, a potential NullReferenceException was identified where .Value is accessed on nullable enum types without a null check. It is recommended to use the null-conditional operator to safely handle these optional fields and prevent runtime crashes.

return "moreThan60Days";

return null;
return value.Value;
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 change from return null; to return value.Value; introduces a potential NullReferenceException when the input value is null. Since this field is optional in the model, it can be null during serialization. Using the null-conditional operator ensures that null is returned safely if the enum instance is missing, while still allowing the raw value to be serialized for unknown enum members.

                return value?.Value;

return "moreThan60Days";

return null;
return value.Value;
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

Potential NullReferenceException if value is null. Use the null-conditional operator to safely handle optional fields during serialization.

                return value?.Value;

return "debit";

return null;
return value.Value;
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

Potential NullReferenceException if value is null. Use the null-conditional operator to safely handle optional fields during serialization.

                return value?.Value;

return "moreThan60Days";

return null;
return value.Value;
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

Potential NullReferenceException if value is null. Use the null-conditional operator to safely handle optional fields during serialization.

                return value?.Value;

return "moreThan60Days";

return null;
return value.Value;
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

Potential NullReferenceException if value is null. Use the null-conditional operator to safely handle optional fields during serialization.

                return value?.Value;

return "other";

return null;
return value.Value;
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

Potential NullReferenceException if value is null. Use the null-conditional operator to safely handle optional fields during serialization.

                return value?.Value;

return "Error";

return null;
return value.Value;
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

Potential NullReferenceException if value is null. Use the null-conditional operator to safely handle optional fields during serialization.

                return value?.Value;

return "CompanyName";

return null;
return value.Value;
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

Potential NullReferenceException if value is null. Use the null-conditional operator to safely handle optional fields during serialization.

                return value?.Value;

return "Success";

return null;
return value.Value;
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

Potential NullReferenceException if value is null. Use the null-conditional operator to safely handle optional fields during serialization.

                return value?.Value;

return "VAT";

return null;
return value.Value;
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

Potential NullReferenceException if value is null. Use the null-conditional operator to safely handle optional fields during serialization.

                return value?.Value;

@gcatanese gcatanese added this pull request to the merge queue May 21, 2026
Merged via the queue into main with commit 4edb98d May 21, 2026
2 checks passed
@gcatanese gcatanese deleted the sdk-automation/payment branch May 21, 2026 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants