I'm using RESTEasy to return Java objects as JSON objects (which is using Jettison Mapped Convention for JSON marshelling).
But I don't want it to return the root node.
For example
@XmlRootElement
public class Car{
private Integer id;
private String name;
}
An object of this class would result in JSON:
{"Car":{"id":6,"name":"someName"}}
Because it's actually coming from
<Car>
<id>6</id>
<name>someName</name>
</Car>
But I don't want the root node. I just want:
{"id":6,"name":"someName"}
So I can use it with client libraries likes Backbone.js
Is there any way (some annotation) to force this on the JSON marshelling ?
Sam,