我试图将我的json请求解析为我的模型。我不知道这段代码有什么问题。 json的语法在Java模型上看起来也是正确的和注释。我不知道为什么我会收到如下错误:
JSON IS:
[
{"Details":"Shows dsdsd details", "requestquery":"id=3915"},
{"Details":"chghar last 10 episodes","requestquery":"id=145434"},
{"Details":"last 10 episodes of reporters","requestquery":"id=1454391"}
]
我的POJO CLASS ARE
public class ThirdPartyDetailsArray {
@JsonProperty("")
private List<ThirdPartyDetails> contentDetails;
public List<ThirdPartyDetails> getContentDetails() {
return contentDetails;
}
public void setContentDetails(List<ThirdPartyContentDetails> contentDetails)
{
this.contentDetails = contentDetails;
}
}
public class ThirdPartyDetails {
private String Details;
private String requestquery;
public String getDetails ()
{
return Details;
}
public void setDetails (String Details)
{
this.Details = Details;
}
public String getRequestquery ()
{
return requestquery;
}
public void setRequestquery (String requestquery)
{
this.requestquery = requestquery;
}
@Override
public String toString()
{
return "ClassPojo [Details = "+Details+", requestquery = "+requestquery+"]";
}
}
但是我得到了上面的错误。 我的代码有什么问题。
答案 0 :(得分:0)
JSON格式正确。
您是否尝试公开Details
和requestquery
属性?