I am using Enunciate to generate documentation for my REST project. The issue I am having is with the example json object that it generates. While the XML representation is correct, the JSON representation of the same object is missing the root element (in the example below it is "env")
Then Java class defining the object type "env"
@Mapped(namespaceMap = {
@XmlNsMap(namespace = "http://example.com/myapp", jsonName = "")
})
@XmlRootElement(name="env")
@XmlAccessorType(XmlAccessType.FIELD)
public static class Environment {
public int id;
public String name;
public String description;
}
The XML documentation generated by Enunciate (which is correct - root element and all)
<?xml version="1.0" encoding="UTF-8"?>
<env xmlns="http://example.com/myapp">
<id>...</id>
<name>...</name>
<description>...</description>
</env>
The JSON documentation generated by Enunciate (which is incorrect - missing root element "env")
{
"id" : ...,
"name" : "...",
"description" : "..."
}
Any help is greatly appreciated.