Closed rzorzorzo closed 5 years ago
String json1 = "{\"1\":{\"2\":[\"3\"]}}"; System.out.println(json1); ObjectMapper mapper = ObjectMapperFactory.create(); Map map = mapper.readValue(json1.getBytes(), Map.class); System.out.println(map); String json2 = mapper.toJson(map); System.out.println(json2);
outputs:
{"1":{"2":["3"]}} {1={2=[3]}} {"map":{"1":{"map":{"2":{"list":["3"],"lazyChop":true,"converted":true,"MAX_ARRAY_SIZE":1}},"lazyChop":true}},"lazyChop":true}`
why not ?
{"1":{"2":["3"]}}
Further :
mapper.readValue(json1.getBytes(), HashMap.class);
returns an empty map.
I have searched this for some hours now, but could not find anything in the docs.
PS: I was using release 0.7 instead of the newest one.
outputs:
why not ?
Further :
returns an empty map.
I have searched this for some hours now, but could not find anything in the docs.