deserialize json field into plain string with gson

后端 未结 2 1509
野的像风
野的像风 2021-01-04 17:41

I am trying to deserialize a json object into a java bean. The main issue I am facing is that I\'d like to treat the field object of the json string as a plain

2条回答
  •  执念已碎
    2021-01-04 18:11

    Just declare it as of type JsonObject

    class ExampleJsonModel {
        @SerializedName("type")
        public String type;
    
        @SerializedName("object")
        public JsonObject object;
    }
    

提交回复
热议问题