org.springframework.http.converter.HttpMessageNotReadableException
Iot-resources 资源管理前端同事传参异常
情景:
资源管理修改API
需要:structureId:22(Integer)
前端入参2:structureId:[22,23,44]
报错:JSON parse error: Cannot deserialize instance of `java.lang.Integer` out of START_ARRAY token
分析:大概指,前端页面传过来的参数与你controller接收的参数类型不匹配
注意事项:
1、参数名和参数一定要匹配正确
2、参数类型与入参匹配 (Integer、String、[])
3、@RequestBody要加在对应需要的参数上,完成json格式的数据进行java对象的转换