-
1. Re: rest-binding quickstart - need help with returning response in JSON
ross.stockman Apr 15, 2013 10:55 AM (in response to ross.stockman)I found a solution. I am now getting the json response that is fully utilizying the jaxb annotations and is supressing null fields. I added the following dependency to the pom:
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jackson-provider</artifactId>
<version>2.3.5.Final</version>
<scope>provided</scope>
</dependency>
Then add the following @NoJackson annotation to the jaxb annotated classes.
import org.jboss.resteasy.annotations.providers.NoJackson;
...
@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement(name = "item")
@NoJackson
public class Item {
@XmlElement(name = "itemId", required = true)
private Integer _itemId;
@XmlElement(name = "changedName", required = false)
private String _name;
@XmlElement(name = "count", required = false)
private String _count;
...
}
-
2. Re: rest-binding quickstart - need help with returning response in JSON
kcbabo Apr 15, 2013 7:43 PM (in response to ross.stockman)Thanks for posting your solution back to the forum.