在返回值JsonObject中,解析出对象集合,转换时报错:
com.alibaba.fastjson.JSONException: not match : - =, info : pos 14, json :..
有问题的代码为:
List<UserBeanDto> allocDtos = JSONArray.parseArray(response.getAllocation().toString(), UserBeanDto.class);
修改如下解决问题:
String responseStr = JSONArray.toJSONString(response.getAllocation());
List<UserBeanDto> allocDtos = JSONArray.parseArray(responseStr, UserBeanDto.class);