Avi Patel
Avi Patel

Reputation: 485

Retrofit Giving Wrong data

Okay, So i am currently working on weather forecast Android App and for that i am using openweathermap API for fetching weather Data. I am getting this response for 5 days weatherforecast. See my Json Response that API gives me here. Now when i parse same API using Retrofit some of the values which i get are either 0 or null. See the Response i get using Retrofit here. You can easily see the difference in Temp_max, Temp_min and other values as the values in API response is correct, but retrofit gives those values as 0.

Upvotes: 1

Views: 133

Answers (1)

Jay Dangar
Jay Dangar

Reputation: 3469

Try using exact naming conventions as you got JsonObject or JsonArray from your API Response or use @SerializeName() from Gson, if you want to use different variable names, Hope this Helps.

Upvotes: 1

Related Questions