当前位置:
首页 >
行业知识 >
JSON parse error: Cannot deserialize value of type `java.util.ArrayList<java.lang.Long>` from Object
行业知识
JSON parse error: Cannot deserialize value of type `java.util.ArrayList<java.lang.Long>` from Object
2026-12-06 18:20:00
来源:互联网转载
JSON parse errindex.php/tags-1038.html" >or: Cannot deserialize value of type `java.util.ArrayList` from Object value (token `JsonToken.START_OBJECT`); nested exception is com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize value of type `java.util.ArrayList` from Object value (token `JsonToken.START_OBJECT`)\n at [Source: (org.springframework.util.StreamUtils$NonClosingInputStream); line: 1, column: 1]
()接口:
public AjaxResult editList( String unit, String ruleValue, @RequestBody List ids){} 第一次写后端接口 前端传过来三个参数, 其中一个参数类型为id组成的数组, 后端对这个ID数组的类型设置成List类型, 请求接口报上面的错误,后来给ids前面加了个@RequestBody注解 再次请求又报下面这个错:
()Uncaught (in promise) Error: Required request parameter 'ruleIds' for method parameter type List is not present
最后无奈改了前端的请求接口:
export function updateList(data) { return request({ url: `/aaa/list?unit=${data.name}&ruleValue=${data.value}`, method: 'put', data: data.ids })}
上一篇:高级版电脑教程
下一篇:酒店服务器怎么校准?