After receiving a JSON response from the back-end that includes an Enum type, I need to deserialize it. The JSON looks like this:
{
...,
pst:['SMS','EMAIL'],
...
}
In Typescript, I have defined my enum class as follows:
export enum PostSynchroActions {
SMS = 'SMS',
Email = 'Email',
SocialWall = 'SocialWall',
Transformation = 'Transformation',
Clone = 'Clone'
}
I am looking to use the json2Typescript library for deserialization. How can I achieve this?
Below is an excerpt of my Typescript class used for deserializing the back-end JSON data:
export class Terminal { ...
@JsonProperty('pst',[PostSynchroActions]) actionPostSynchro:PostSynchroActions[] = [];
...
}