问题
使用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中该属性为对象,故序列化失败
办法
下面方案二选一
- 将postman中问题属性改为对象;
- 将java object中问题属性该为数组