Skip to content

Fix union types deserialization with transfer webhooks#1489

Merged
gcatanese merged 2 commits into
Adyen:mainfrom
mercury2269:main
May 12, 2025
Merged

Fix union types deserialization with transfer webhooks#1489
gcatanese merged 2 commits into
Adyen:mainfrom
mercury2269:main

Conversation

@mercury2269
Copy link
Copy Markdown
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
Copy Markdown
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