GSON Expected BEGIN_ARRAY but was BEGIN_OBJECT

前端 未结 3 1695
你的背包
你的背包 2020-11-30 08:12

I\'m getting this error when I receive only one single item in a list. I\'m using Jersey in the server side REST Web service, I only get the error when the List returned one

3条回答
  •  执笔经年
    2020-11-30 08:38

    I ended up using Jackson library instead of gson to parse the json response. It automatically converts object into ArrayList. It is pretty much similar to gson in terms of ease of use. Hope it helps!

提交回复
热议问题