The following response comes to the request
{ "status": "success", "message": "Успешный запрос", "code": 200, "data": { "2018-02-12": [ 36, 37, 38, 39, 40 ], "2018-02-13": [ 41, 42, 43, 44, 45 ] } } That is, the response data comes with variable keys: today, tomorrow will be "2018-02-13" and "2018-02-14", and so every day.
Processing jsonschema2pojo data under the key "data" yields the following model:
package NNN.NNNN.NNNNN.model; import java.util.List; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; public class Data { @SerializedName("2018-02-12") @Expose private List<Integer> _20180212 = null; @SerializedName("2018-02-13") @Expose private List<Integer> _20180213 = null; public List<Integer> get20180212() { return _20180212; } public void set20180212(List<Integer> _20180212) { this._20180212 = _20180212; } public List<Integer> get20180213() { return _20180213; } public void set20180213(List<Integer> _20180213) { this._20180213 = _20180213; } } It is clear that such a model will become obsolete in a day and will produce empty values. Tell me, can such an answer be automatically parsed using the Retrofit library or only manually?