MismatchedInputException: Cannot deserialize instance of `xxx` out of START_ARRAY token

问题

使用postman向端发送请求时,出现
org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: Cannot deserialize instance of `xxx` out of START_ARRAY token; nested exception is com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance of `xxx` out of START_ARRAY token

原因

postman发送的特定字段为数组,但java object中该属性为对象,故序列化失败

办法

下面方案二选一

  1. 将postman中问题属性改为对象;
  2. 将java object中问题属性该为数组
上一篇:428. Serialize and Deserialize N-ary Tree 序列化、反序列化n叉树


下一篇:Jaskson精讲第6篇-自定义JsonSerialize与Deserialize实现数据类型转换