Parse a nested json with retrofit 2.0

前端 未结 2 1360
再見小時候
再見小時候 2020-12-21 09:32

i have this json\'s and i want to use retrofit for parsing them.

{
  \"status\": \"true\",
  \"data\": [
{
  \"id\": \"1\",
  \"title\": \"Hi :)\",
  \"text         


        
2条回答
  •  -上瘾入骨i
    2020-12-21 10:35

    Root node of your json is not array, but you declared it as List at interface getPost. So you need to use responseStatus instead current one. And use gettter to access data

    @SerializedName("data")
    private ArrayList data;
    

    which is array

提交回复
热议问题