如何从我的JSON输出中删除type
。我有一个包含REST服务输出的类/bean。我正在使用jersey-media-moxy
进行转换。
该服务
@Resource
public interface MyBeanResource
{
@GET
@Path("/example")
@Produces( MediaType.APPLICATION_JSON )
public Bean getBean();
}
豆子
@XmlRootElement
class Bean
{
String a;
}
我想添加一些功能(用于使用构造函数初始化bean)
class BeanImpl extends Bean
{
BeanImpl(OtherClass c)
{
a = c.toString()
}
}
输出的JSON为:
{type:"beanImpl", a:"somevalue"}
我不想在我的JSON中包含type
。我该如何配置?