I know that Jackson allows you to create flat json using @JsonUnwrapped to make a class object like
public class Person { public int age; @JsonUnwrapped public Name name; public class Name { public String first, last; } }
will be serialized to
{"age" : 99, "first" : "Name", "last" : "Surname"}
however, I cannot find a way to do the opposite - have a class like
public class Person { public int age; public String firstName, lastName; }
and its object is serialized and deserialized from
{"age" : 99, "name" : {"first" : "Name", "last" : "Surname"}}
Is this possible using Jackson 1.9?
java json jackson
user3189503
source share