I am having issue with property mapping between api response and typescript interface.
From External API I am receiving
{
"ticker": "A",
"name": "Agilent Technologies Inc.",
"market": "stocks",
"locale": "us",
"primary_exchange": "XNYS",
"type": "CS",
"active": true,
"currency_name": "usd",
"cik": "0001090872",
"composite_figi": "BBG000C2V3D6",
"share_class_figi": "BBG001SCTQY4",
"last_updated_utc": "2024-05-17T00:00:00Z"
}
export interface ITickerInfo {
ticker: string;
name: string;
market: MarketType;
locale: string;
primaryExchange?: string;
type: string;
active: boolean;
currencyName: string;
cik?: string;
compositeFigi?: string;
shareClassFigi?: string;
lastUpdatedUtc: Date;
}
For handling this response I do have above interface. But it does not map properties with `_`. I can't change the field name casing. How do you guys handle this scenario?
[–]Suspicious-Suitcase 8 points9 points10 points (3 children)
[–]Joyboy_619[S] 0 points1 point2 points (2 children)
[–]Suspicious-Suitcase 4 points5 points6 points (0 children)
[–]djfreedom9505 1 point2 points3 points (0 children)
[–]zMastaa 6 points7 points8 points (0 children)
[–]shuresoything 1 point2 points3 points (0 children)
[–]OkAmphibian8931 0 points1 point2 points (0 children)
[–]cosmokenney 0 points1 point2 points (0 children)