Multiple top level items in a JSON response?
I'm trying to return a JSON object from a request which is working fine. The problem is I'm using a 3rd party javascript plugin and it's looking for something at the top level, but Spring is returning the object first. Here's an example of what I mean.
Code:
@RequestMapping(...)
public MyModel getItems(...) {
...
return myModel;
}
Here is what is returned to the browser:
{"myModel":{"myItem1":2,"myItem2":2}}
Is there a way to only show the sub-items as the top level instead of the main object?
What I want is this:
{"myItem1":2,"myItem2":2}