how do i map the below json to a java class, where the key is dynamic
{
"steps":
{
"1":{
a:"a",
b:"b",
c:"c"
},
"2":{
a:"a",
b:"b",
c:"c"
},
"3":{
a:"a",
b:"b",
c:"c"
}
}
}
Normally, if the json object is of this kind, it is easy to map to an object.
{
"steps":
[
{
a:"a",
b:"b",
c:"c"
},
{
a:"a",
b:"b",
c:"c"
},
{
a:"a",
b:"b",
c:"c"
}
]
}
And the class for this will be:
public class Example
{
private Steps[] steps;
}
public class Steps
{
private String b;
private String c;
private String a;
}