{
"id": 13,
"name": "horst",
}
in order to
interface A {
id: string;
name: string;
}
When converting JSON data of type A
to an object, I expected the conversion of id
from number to string to happen automatically. However, it doesn't convert as expected.
I would like the conversion from number to string to occur through type inference when parsing JSON into an object. Is there a way to achieve this?
PS. English is not my first language, apologies for any mistakes in my writing..