[英]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.