I have a JBoss RestEasy - SPring - Hibernate integrated into an app.
My API call is like the following
@GET
@Path("/all")
public List<Foo> getAllFoos() {
return fooService.getAllFoos();
}
My Foo class is Annotated like the following
@XmlRootElement
public class Foo {
@XmlElement
String test;
}
I am getting my JSON ouput as
[{"foo":{"test":"bill"}},{"foo":{"test":"monica}"}}]
I want to get
[{"test":"bill"},{"test":"monica}"}]
Thank you in advance. @peekskillet
Here are the dependencies related to rest easy
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jaxrs</artifactId>
<version>2.2.1.GA</version>
</dependency>
<!-- JBoss JAXB -->
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jaxb-provider</artifactId>
<version>2.2.1.GA</version>
</dependency>
<dependency>
<!-- RestEasy Spring -->
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-spring</artifactId>
<version>2.2.1.GA</version>
<exclusions>
<exclusion>
<artifactId>commons-logging</artifactId>
<groupId>commons-logging</groupId>
</exclusion>
<exclusion>
<artifactId>sjsxp</artifactId>
<groupId>com.sun.xml.stream</groupId>
</exclusion>
<exclusion>
<artifactId>jsr250-api</artifactId>
<groupId>javax.annotation</groupId>
</exclusion>
<exclusion>
<artifactId>activation</artifactId>
<groupId>javax.activation</groupId>
</exclusion>
</exclusions>
</dependency>