My Controller returns a list of MyObj objects (using @ResponseBody)
public MyObj
{
int a;
int b;
}
The return JSON looks like this:
[{"a":1,"b":2},{"a":2,"b":2}]
I would like to wrap this JSON so it will return something like:
{ "data": [{"a":1,"b":2},{"a":2,"b":2}]}
From what i read i need to enable SerializationConfig.Feature.WRAP_ROOT_VALUE or (?) use @JsonRootName("data") on top of my controller.
Also tried the @XmlRootElement, nothing seems to work. Any idea what is the right way to wrap the list of objects with a root name?