1、微服务之间调用 A调用B B 返回 ResData<List<T>>类型,实际返回结果内容为空,返回参数如下:
{
"code": 0,
"msg": "OK",
"data": {}
}
feign.codec.DecodeException: JSON parse error: Can not deserialize instance of java.util.ArrayList out of START_OBJECT token; nested exception is com.fasterxml.jackson.databind.JsonMappingException: Can not deserialize instance of java.util.ArrayList out of START_OBJECT token
at [Source: (PushbackInputStream); line: 1, column: 29]
2.解决思路
a. A服务调用B时避免出现空数据的情况
b.B服务返回做兜底逻辑,无数据返回空list
{
"code": 0,
"msg": "OK",
"data": []
}