我有一个第三方的回应如下
[
{
"url": "https://abc/10",
"created": "2021-02-26 10:45:14",
"status": "approved",
"ref": "12452",
"brand": "edr",
"reason": "jkjkj"
},
{
"url": "https://bvc/20",
"created": "2021-02-26 10:43:18",
"status": "rejected",
"ref": "14562",
"brand": "yghj",
"reason": "asd",
}
]
我们有一节课。
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class GetDetails {
private List<Detail> details = new ArrayList<>();
// getters, setters and toString()
}
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class Detail {
@JsonProperty(value = "url")
private String url;
@JsonProperty(value = "created")
private Instant created;
@JsonProperty(value = "status")
private String status;
@JsonProperty(value = "ref")
private String ref;
@JsonProperty(value = "brand")
private String brand;
@JsonProperty(value = "reason")
private String reason;
//Getters, Setters and toString()
}
但在转换过程中,我们得到了以下错误
error com.openbet.commons.sdk.common.util.requestsenderimpl-http交换期间出现意外异常:org.springframework.http.converter.httpMessageNotradableException:json分析错误:无法反序列化的示例 com.document.GetDetails
启动外\u数组令牌;嵌套异常为com.fasterxml.jackson.databind.exc.missmatchdinputException:无法反序列化的示例 com.document.GetDetails
启动外\u数组令牌
有人能告诉我我做错了什么吗?
1条答案
按热度按时间js5cn81o1#
案例的方法签名示例。
json中没有details属性
您正在尝试转换下面的示例,因此无法转换它