Opposite implementation of @JsonUnwrapped
See original GitHub issueSerializing object of the following class yeilds string like
public class User implements Serializable{
private Integer id;
private String name;
private Integer pinCode;
private String city;
// getters /setters
}
{“id”:1,“name”:“XYZ”,“pinCode”:123456,“city”:“ABC”} But we want that attributes pinCode and city should be a part of new Json node say address node.
So my expectation of the result is:
{ “id”: 1, “name”: “XYZ”, “address”: { “pinCode”: 123456, “city”: “ABC” } } Can this be accomplished without re-organizing the class structure and by using Json annotations
on the exact opposite lines of @JsonUnwrapped
http://stackoverflow.com/questions/37724834/jackson-serialize-and-wrap-attributes-into-a-new-object
Issue Analytics
- State:
- Created 7 years ago
- Comments:11 (4 by maintainers)
Top Results From Across the Web
java - What's the Jackson deserialization equivalent of ...
Are you certain @JsonUnwrapped is working for deserialization? I just tried it and am getting Could not read JSON: Unrecognized field... errors ...
Read more >Guide to Jackson Annotations | Novixys Software Dev Blog
Introduction. Jackson provides a number of annotations which help tweak various facets of JSON serialization and deserialization.
Read more >Jackson Annotations For Java Application - GeeksforGeeks
Java has immense application in the coding world, and almost all of us ... public class UnwrappedUser { public int id; @JsonUnwrapped public ......
Read more >FasterXML - Bountysource
@JsonUnwrapped allows people who want a more compressed JSON hierarchy than their POJO to affect the process, but there is no option for...
Read more >Deserializing @JsonUnwrapped fields with @JsonCreator ...
class Place { public final String name; @JsonUnwrapped public final ... implementation limitation and not hard limit, of course, but
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ll unlock the other issue hoping users will add reactions – it works well enough for “voting” purpose here, and I’ll delete +1s if any.
@andredasilvapinto I don’t track it regularly, but I sometimes go through lists of open issues. It’s not a prime signal in general, but sort of “better than nothing”, and is something users can do to indicate their preference.