Gson: How do I parse polymorphic values that can be either lists or strings?

前端 未结 4 418
心在旅途
心在旅途 2021-01-27 11:57

I need to parse a JSON file that contains long list of customers. In the JSON file each customer may have one id as a string:

{
  \"cust_id\": \"87655\",
  ...
}         


        
4条回答
  •  一生所求
    2021-01-27 12:19

    Refer this.

    Now the problem is that you will have to write your own code on the returned map to get the desired result.

提交回复
热议问题