I have a List with Person's in Java and each person has an id:
class Person{
public int id;
public String name;
}
Now I like to serialize this list in a JSON like that:
{
"1":{
"name": "tom"
},{
"2":{
"name": "bob"
}
}
Is there any anotation for the class which contains the list, to specify the JSON structure?
Thanks.