JSON parse error: Cannot deserialize instance of `java.util.ArrayList` out of START_OBJECT token; ne

JSON parse error: Cannot deserialize instance of java.util.ArrayList out of START_OBJECT token; nested exception is com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance of java.util.ArrayList out of START_OBJECT …

其实就是json数据的转换异常,前端给的是一个json对象,而后段需要的是一个List。
在这个json对象前后加[ ]即可。

有时候也可能是前端给的json对象和后端写的Java对象的成员变量不一一对应,就无法转换。


版权声明:本文为shihao1998原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。