Skip to content

Fix union types deserialization with transfer webhooks #1489

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 12, 2025

Conversation

mercury2269
Copy link
Contributor

@mercury2269 mercury2269 commented Apr 24, 2025

Description
There is a serialization issue in transferData object.

transferData.tracking property uses a union type:

'tracking'?: ConfirmationTrackingData | EstimationTrackingData | InternalReviewTrackingData | null;

but TransferWebhooks ObjectSerializer doesn't understand union types, so returns the data without converting it to the correct object. This creates an underlying bug where the TypeScript type of the EstimattionTrackingData.estimatedArrivalTime is Date but the runtime type is a string.

Tested scenarios
Scenario that tests EstimatedTrackingData type is correctly de-serialized

Fixed issue:
N/A

@gcatanese
Copy link
Contributor

Thank you for the contribution!!

@gcatanese gcatanese merged commit 9a704a7 into Adyen:main May 12, 2025
5 checks passed
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