我有以下需要转换为地图的字符串值,我使用了以下代码
String parameters='[{"key":"login","value":"admin"},{"key":"Createddate","value":"cairo"}]';
ObjectMapper mapper = new ObjectMapper();
Map<String, String> map ;
map = mapper.readValue(parameters, new TypeReference<Map<String, String>>(){});
System.out.println(map);
我收到以下错误
com.fasterxml.jackson.databind.JsonMappingException: Can not
deserialize instance of java.util.LinkedHashMap out of START_ARRAY token
at [Source: [{"key":"login","value":"admin"},
{"key":"Createddate","value":"cairo"}]; line: 1, column: 1]