I am wondering how to do this transformation.
I normally transform from json to Java objects like this:
{
"detail" :
{
"student": {
"name" : "John Doe",
"age" : 31
}
}
}
So I can easily create a Java object called student and do something like this
public class Student {
String name;
int age;
public Student(@JsonProperty("name") String name, @JsonProperty("age") int age){
this.name = name;
this.age = age;
}
}
But now I am facing this issue...
I am getting a JSON like this:
{
"detail" :
{
"123456789": {
"name" : "John Doe",
"age" : 31
}
}
}
Where 123456789 is in this case, the "student" ...
Is there anyway I can design an object to parse from JSON to my java object? I have no idea how to do this trick...