Skip to content

[disputewebhooks] Code generation: update services and models#1706

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

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

Conversation

@AdyenAutomationBot
Copy link
Copy Markdown
Collaborator

This PR contains the automated changes for the disputewebhooks 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 modifies the DisputeEventNotification and DisputeNotificationRequest models to enhance enum deserialization by providing a fallback cast for raw string values. The review identifies potential issues with casting nullable strings to non-nullable enums, which could trigger compiler warnings, and highlights a risk where a non-nullable property might be assigned a null value during deserialization.

case "type":
string? typeRawValue = utf8JsonReader.GetString();
type = new Option<DisputeEventNotification.TypeEnum?>(DisputeEventNotification.TypeEnum.FromStringOrDefault(typeRawValue));
type = new Option<DisputeEventNotification.TypeEnum?>(DisputeEventNotification.TypeEnum.FromStringOrDefault(typeRawValue) ?? (DisputeEventNotification.TypeEnum)typeRawValue);
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 cast (DisputeEventNotification.TypeEnum)typeRawValue is to a non-nullable type, which may trigger a compiler warning since typeRawValue can be null. It is safer and more consistent with the Option<TypeEnum?> wrapper to cast to TypeEnum?.

                            type = new Option<DisputeEventNotification.TypeEnum?>(DisputeEventNotification.TypeEnum.FromStringOrDefault(typeRawValue) ?? (DisputeEventNotification.TypeEnum?)typeRawValue);

case "type":
string? typeRawValue = utf8JsonReader.GetString();
type = new Option<DisputeNotificationRequest.TypeEnum?>(DisputeNotificationRequest.TypeEnum.FromStringOrDefault(typeRawValue));
type = new Option<DisputeNotificationRequest.TypeEnum?>(DisputeNotificationRequest.TypeEnum.FromStringOrDefault(typeRawValue) ?? (DisputeNotificationRequest.TypeEnum)typeRawValue);
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 cast (DisputeNotificationRequest.TypeEnum)typeRawValue is to a non-nullable type, which may trigger a compiler warning since typeRawValue can be null. It is safer and more consistent with the Option<TypeEnum?> wrapper to cast to TypeEnum?.

                            type = new Option<DisputeNotificationRequest.TypeEnum?>(DisputeNotificationRequest.TypeEnum.FromStringOrDefault(typeRawValue) ?? (DisputeNotificationRequest.TypeEnum?)typeRawValue);

var disputeNotificationRequest = new DisputeNotificationRequest();
disputeNotificationRequest.Data = data.Value!;
disputeNotificationRequest.Type = type.Value!.Value;
disputeNotificationRequest.Type = type.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.

medium

The property Type is defined as non-nullable, but type.Value can be null if the JSON contains "type": null. Using the null-forgiving operator ! suppresses the compiler warning but allows an invalid null state for a required property. Consider adding a null check or making the property nullable to ensure robust handling of null values in the JSON payload.

@gcatanese gcatanese added this pull request to the merge queue May 21, 2026
Merged via the queue into main with commit 09cf41f May 21, 2026
2 checks passed
@gcatanese gcatanese deleted the sdk-automation/disputewebhooks branch May 21, 2026 13:03
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