I want to store "data"
Data :
{
"api_status": 200,
"data": [
{"id": "755", "post_id": "755", "publisher": { "username": "test1", "email": "test1@gmail.com"}},
{"id": "765","post_id": "765","publisher": { "username": "test2", "email": "test2@gmail.com"}}
]
}
I created this to receive data ModelPost.java
public class ModelPost {
Integer api_status ;
List<Data> data ;
}
Data.java
public class Data {
String id, post_id, postText;
Publisher publisher;
}
Publisher.java
public class Publisher {
String username, email;
}
The problem is in the ModelPost.java file when the data type is List<Data> data ;
an error occurs but when I type List<Any> data ;
instead of List<Data> data ;
I can receive the data but the data is a string