I have an object like this:

class Foo {
   Map<String, String[]> map;
}

using JsonInclude.NON_EMPTY in the default serializer.

Suppose that map = {"key": []}. What is the expected serialization? Should 
"key": [] be present in the output JSON?

I can see two arguments:
- Option A: map is a property of Foo, but "key" is just part of its value. 
It's not a property, so "map: {"foo": []}" should appear in the result JSON.
- Option B: JSON doesn't really distinguish Objects and Maps, so we treat 
both foo.map and map.get("key") as JSON properties. According to NON_EMPTY, 
"key" should be omitted.

The current behavior is Option B, which I found surprising at first when 
reading the NON_EMPTY documentation. Wondering if this is a conscious 
choice and the expected behavior, or a bug, or something else?

Thanks!
Dan

-- 
You received this message because you are subscribed to the Google Groups 
"jackson-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to