Details
-
Type:
New Feature
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.5.2
-
Fix Version/s: 1.6
-
Component/s: Serializer
-
Labels:None
-
Number of attachments :
Description
(idea came via jackson-users.ning.com discussion, suggested by Henrik Lundgren)
—
It would be nice to be able to do inverse of @JsonAnySetter – define a method that returns a Map (or possibly just collection of Map.Entry instances, or even just iterator?) and entries would be serialized as main-level attributes of enclosing object on serialization.
Although it would be possible to further generalize this idea (@JsonUnwrap?), for now it may be best value for development time to implement this in more limited form.
Note:
JACKSON-132is related; this issue can be seen as subset of it.Also, note that both @JsonAnyGetter and @JsonAnySetter should be applicable to Map fields.