There is an issue in the retrofit library that I am facing in the dynamic data JSON response.
For example, if any key in the JSON is of int type and due to some reason the particular key type is changed to string. Now corresponding to the first JSON response when the key was of int type the model class was created. Now my question is I want to handle the updated string format JSON. How should I solve this task?
Below is the ApiClient class of the retrofit.
public class ApiClient
{
public static final String BASE_URL = "http:***********";
private static Retrofit retrofit = null;
public static Retrofit getClient() {
if (retrofit==null) {
retrofit = new Retrofit.Builder()
.baseUrl(BASE_URL)
.addConverterFactory(GsonConverterFactory.create())
.build();
}
return retrofit;
}
}
I have got some solutions which use the rest adapter but I want to solve using the above format. How I should do please guide.