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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

mercury2269
Copy link

@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

@mercury2269 mercury2269 requested a review from a team as a code owner April 24, 2025 14:26
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.

1 participant