struggling to validate and interpret api response:
const Bar = t.type({
identifier: t.number,
timestamp: DateFromISOString,
});
type BarType = t.TypeOf<typeof Bar>;
const jsonBar: BarType = {"identifier": 1, "timestamp": "2022-01-15T09:45:10.123Z"};
const resultBar = Bar.decode(jsonBar);
the issue arises from the fact that the type defines timestamp property as a date while it's actually a string in the jsonBar
Am I overlooking something here or do I need separate types for the incoming data and decoded object?