-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Add support for @JsonInclude(content=Include.NON_NULL)
(and NON_EMPTY) for Maps
#527
Milestone
Comments
cowtowncoder
added a commit
that referenced
this issue
Oct 17, 2014
cowtowncoder
changed the title
Add support for
Add support for Oct 20, 2014
@JsonInclude(contents=Include.NON_EMPTY)
for Maps@JsonInclude(contents=Include.NON_NULL)
(and NON_EMPTY) for Maps
Implementation was slightly more involved than expected, but things work now. Note, however, that #588 should be implemented too, to be able to properly cascade case of |
cowtowncoder
changed the title
Add support for
Add support for May 17, 2016
@JsonInclude(contents=Include.NON_NULL)
(and NON_EMPTY) for Maps@JsonInclude(content=Include.NON_NULL)
(and NON_EMPTY) for Maps
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
(and other inclusion values)
Currently use of something like:
only affects value itself. But for structured values (arrays,
Collection
s,Map
s), there is also the question of inclusion strategy for contents.Currently the only way to control such inclusion is via global feature
SerializationFeature.WRITE_NULL_MAP_VALUES
, and that only affects handling ofMap
s.But it would seem reasonable to add an additional property in
@JsonInclude
, say,contents
, and modify structured type serializers to consider this for filtering.The first one to use it with should be
Map
(and specialized variants likeEnumMap
). But due to amount of work involved, let's add support for arrays andCollection
s if and when specifically requested.The text was updated successfully, but these errors were encountered: