GSON throwing “Expected BEGIN_OBJECT but was BEGIN_ARRAY”?

后端 未结 10 657
暖寄归人
暖寄归人 2020-11-22 01:31

I\'m trying to parse a JSON string like this one

[
   {
      \"updated_at\":\"2012-03-02 21:06:01\",
      \"fetched_at\":\"2012-03-02 21:28:37.728840\",
           


        
10条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-22 01:55

    according to GSON User guide, you cannot.

    Collections Limitations

    Can serialize collection of arbitrary objects but can not deserialize from it. Because there is no way for the user to indicate the type of the resulting object

提交回复
热议问题