I have api with all request like:
{
"success": "true",
"data": [],
"errors": []
}
For example:
{
"success": "true",
"data": [
{
"id": "666",
"name": "Cars",
"imgUrl": "/images/mod_catalog_prod/categories/no-image.jpg",
"descr": "",
"childRubricCount": 20
},
{
"id": "667",
"name": "Buses",
"imgUrl": "/images/mod_catalog_prod/categories/no-image.jpg",
"descr": "",
"childRubricCount": 14
}
],
"errors": []
}
Also if success==true is possible call onResponse block and if success==false call onFailure block with error text from errors variable from json. Api contains different response data models for data block in json response and i need that data model class would be dynamically changed. Is there the way to create something like this? All responses will be useful for me.