ObjectMapper mapper = new ObjectMapper();
List<String> stringIds = mapper.readValue(result, new TypeReference<List<String>>(){});
其中结果 = { "stringids": [ "abc", "xyz" ] }
所以对于 Input {
"stringids": [
"abc",
"xyz"
]
},我希望结果是字符串 abc, xyz 的列表
尝试上述代码时出现此异常:-
com.fasterxml.jackson.databind.JsonMappingException: Can not deserialize instance of java.util.ArrayList out of START_OBJECT token