ClassCastException: org.json.simple.JSONArray cannot be cast to org.json.simple.JSONObject

后端 未结 3 663
一向
一向 2021-01-15 15:44

I am trying to parse a son file, and I don\'t know what I\'m doing wrong (of course, I don\'t really know what I\'m doing right, either).

file.json



        
3条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-15 16:18

    You should cast your obj toJsonArrayinstead of JsonObject, because your json file has [] at the root.

提交回复
热议问题