I have to build java objects with following json structure.
sample:
{
"parent":""
"children":[
{
"parent":"abc"
"children":[
parent:"ccd"{
"children":[]
}
]
}
}
}
I have json like this where a parent can have child object and this child object act as parent to another child object and the chain can increase dynamically . How can we model object so that I can form json object like above from my API.
Thanks in advance
One way to do this would be to store the same Object type as your child, so in this case you would get something like this;