I need to decode the following JSON-Structure:
{
"id":1
"categories": [
value_of_category1,
value_of_category2,
value_of_category3
]
}
The object I am trying to deserialize into is of the following class:
class MyClass {
public Integer id;
public Category1 category1;
public Category2 category2;
public Category3 category3;
...
}
public enum Category1{
...
}
public enum Category2{
...
}
public enum Category3{
...
}
In the JSON the first entry of the categories-Array is always a value of the enum Category1, the second entry is always a value of the enum Category2 and the third entry is always a value of the enum Category3.
How can I deserialize this JSON into my class structure using Jackson?