I'm trying to map the following json via jackson to a pojo. I have the first part working (up until section). However, the second part I'm not sure how I can map "section1" to perhaps a contained pojo or best practice here?
json received via rest call:
{
"val1":100,
"val2":2.75,
"junk":[
{
"junk1":36,
"junk2":78
},
{
"junk1":36,
"junk2":78
}
],
"section1":{ // <- There will be another section2, section3,...
"val1":100,
"val2":2.75,
"junk1":[
{
"junk1":36,
"junk2":78
},
{
"junk1":36,
"junk2":78
}
],
"junk2":[
{
"junk1":36,
"junk2":78
},
{
"junk1":36,
"junk2":78
}
]
}
}
Pojo:
public class view
{
private int val1;
private float val2;
private List<Map<String, String> > junk; //<-Ok as I just pass to another class
// How to store "section" ... and want to keep junk1, junk2 same
// placeholder like I have for junk in main section above.
}