Why can't I unwrap the root node and deserialize an array of objects?

前端 未结 3 1389
野的像风
野的像风 2021-01-07 15:20

Why am I not able to deserialize an array of objects by unwrapping the root node?

import java.io.IOException;
import java.util.Arrays;
import java.util.List         


        
3条回答
  •  时光取名叫无心
    2021-01-07 15:58

    it seems you can't escape a wrapper class. according to this, the @JsonRootName annotation will only allow you to unwrap a json that contains a single instance of your pojo: so it will work for a String like this: "{\"customer\":{\"email\":\"hello@world.com\"}}";

提交回复
热议问题