我正在尝试将json数组列表数据发布到spring rest调用并执行我的逻辑,如下所示
模特课程:
public class ABCDEF{
private String A;
private String B;
private ArrayList<Long> C;
private ArrayList<Long> D;
private ArrayList<String> E;
private String F;
//getter //setter
}
休息电话:
@RequestMapping(value="/post/data", method = RequestMethod.POST,consumes = "application/json", produces = "application/json")
public List<ModelClass1> retrieveData(@RequestBody List<ABCDEF> dataFromUser){
return null;
}
输入尝试:
[
{
"A" : "something",
"B":"something",
"C":[1],
"D": [1,2],
"E":["123","1234"],
"F":"something"
},
{
"A" : "something",
"B":"something",
"C":[4,5],
"D": [7,8,9],
"E":["1111","9999"],
"F":"something"
}
]
但它抛出异常,
nested exception is com.fasterxml.jackson.databind.JsonMappingException: Can not deserialize instance of com.ABCDEF out of START_ARRAY token
我在哪里做错了?