I have a Java servlet sending JSON with jackson/jersey. I have to send a tree. This is my data structure.
public class Node {
private String text;
private String link;
private List<Node> items;
[...]
}
i.e i request /
I want the first level only, answer should be :
{
"text":"toto",
"link":"",
"items":[{
"text":"toutou",
"link":"tata",
]}
}
and if i request /tata
answer should be :
{
"text":"toutou",
"link":"tata",
"items":[{
"text":"toto2",
"link":"toutou2",
]}
}
So i only want to send 1 level of items
because otherwise the JSON would be too big.
Is it possible ?
Thanks,