Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions src/typings/transferWebhooks/transferDataTracking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,7 @@ export type TransferDataTracking = ConfirmationTrackingData | EstimationTracking
*/
export class TransferDataTrackingClass {

static readonly discriminator: string | undefined = "type";
static readonly discriminator: string = "type";

static readonly mapping: {[index: string]: string} | undefined = {
"confirmation": "ConfirmationTrackingData",
"estimation": "EstimationTrackingData",
"internalReview": "InternalReviewTrackingData"
};
static readonly mapping: {[index: string]: string} | undefined = undefined;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

Removing the mapping from TransferDataTrackingClass will break the deserialization of the TransferDataTracking union type. The ObjectSerializer relies on this mapping to instantiate the correct class (e.g., ConfirmationTrackingData, EstimationTrackingData) based on the value of the type discriminator field. Without this mapping, the tracking property in webhooks will be deserialized as a plain object instead of an instance of the correct class. This will likely cause the test should correctly deserialize union types in transfer webhooks to fail and lead to runtime errors.

    static readonly mapping: {[index: string]: string} = {
        "confirmation": "ConfirmationTrackingData",
        "estimation": "EstimationTrackingData",
        "internalReview": "InternalReviewTrackingData"
    };

}
Loading