[英]Object missing in json object structure response in jersey
这是我简化的对象结构:
@xmlRootelement
ArticleList implements Serializable{
//ArrayList of articles
}
Article implements Serializable
{
User user;
//ArrayList of bids
}
User implements Serializable
{
//Properties
}
Bid implements Serializable
{
//Properties
}
功能标头:
@GET
@Path("/article-search")
@Produces( MediaType.APPLICATION_JSON )
public ArticleList articleSearch() {
//Function code here
}
我返回球衣功能中的ArticleList。 在答案中,我检查是否存在带有元素的对象出价。
问题是在响应中找不到json对象的任何元素Bids
响应示例:
{
"articles":[
{
//Some Props. Here
"user":{
//Some Props. Here
}
//Here list of bids is missing. It is verified that the list contains elements
}
]
}
我需要在对象Article中添加Bid数组列表的获取器和设置器
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.