I'm working on creating an API that has nested lists. Jackson seems like a great tool to create objects, but I can't quite figure out how to nest a list, and I'm wondering if its possible.
My object looks like this.
public class Order {
public String name;
public List<Item> items;
}
I'm hoping there is a way to map it to json that looks something like:
{
name : "A name"
items : {
elements : [{
price : 30
}]
}
}
We want to be able to do this so we can add properties to lists.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…