Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for missing values (non-compliant JSON) #117

Closed
cemo opened this issue Nov 13, 2013 · 2 comments
Closed

Support for missing values (non-compliant JSON) #117

cemo opened this issue Nov 13, 2013 · 2 comments
Milestone

Comments

@cemo
Copy link

cemo commented Nov 13, 2013

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));
@cowtowncoder cowtowncoder changed the title Support for missing values Support for missing values (non-compliant JSON) Sep 30, 2014
cowtowncoder added a commit that referenced this issue Mar 29, 2016
Fix for issue #117 - Supports the missing values in an array
@cowtowncoder cowtowncoder added this to the 2.8.0 milestone Mar 29, 2016
@cowtowncoder
Copy link
Member

Thanks to @LokeshN this is now implemented, will be in 2.8.0.

@cowtowncoder
Copy link
Member

Looks like implementation lead to #616 (non-closing root level stream, serving VALUE_NULLs.).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants