-
-
Notifications
You must be signed in to change notification settings - Fork 819
Closed
Milestone
Description
This is not my top priority but might be useful for someone else too. As we discussed at FasterXML/jackson-databind#345, I am opening this issue for further references.
ObjectMapper objectMapper = new ObjectMapper();
objectMapper.configure(JsonParser.Feature.ALLOW_UNQUOTED_FIELD_NAMES, true);
objectMapper.configure(JsonParser.Feature.ALLOW_SINGLE_QUOTES, true);
objectMapper.enable(DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT);
String str = "{a:[1,2,3]}";
Map x = objectMapper.reader(Map.class).readValue(str);
System.out.println(((ArrayList)x.get("a")).get(0));
str = "{a:[1,null,3]}";
x = objectMapper.reader(Map.class).readValue(str);
System.out.println(((ArrayList)x.get("a")).get(0));
str = "{a:[1,,3]}";
x = objectMapper.reader(Map.class).readValue(str);
System.out.println(((ArrayList)x.get("a")).get(0));
Metadata
Metadata
Assignees
Labels
No labels