You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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));
The text was updated successfully, but these errors were encountered:
cowtowncoder
changed the title
Support for missing values
Support for missing values (non-compliant JSON)
Sep 30, 2014
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.
The text was updated successfully, but these errors were encountered: