What's the Jackson deserialization equivalent of @JsonUnwrapped?

后端 未结 4 1172
天命终不由人
天命终不由人 2020-12-01 13:43

Say I have the following class:

public class Parent {
  public int age;
  @JsonUnwrapped
  public Name name;
}

Producing JSON:



        
4条回答
  •  温柔的废话
    2020-12-01 14:11

    @JsonUnwrapped works for both serialization and deserialization, you shouldn't need to take any additional steps.

提交回复
热议问题