无法使用 jackson objectmapper 读取响应。退出 START_OBJECT 令牌。这是输入的 json 和错误消息。PaymentResponse java pojo 是通用代码,我无权添加任何注释。添加反序列化配置有什么帮助吗?
ObjectMapper objectMapper = new ObjectMapper();
PaymentResponse[] paymentResponse = objectMapper.readValue(serverResponseStr, PaymentResponse[].class);
{
"PaymentResponse[]": [
{
"uid": "111",
"name": "kiran"
},
{
"uid": "112",
"name": "kumar"
}
]
}
Can not deserialize instance of PaymentResponse[] out of START_OBJECT token
com.fasterxml.jackson.databind.JsonMappingException: Can not deserialize instance of PaymentResponse[] out of START_OBJECT token
at [Source: {"PaymentResponse[]": [{"uid": "111","name": "kiran"},{"uid": "112","name": "kumar"}]}
UYOU
相关分类