79086313

Date: 2024-10-14 13:22:12
Score: 0.5
Natty:
Report link

Solved, I had to fix my RetrofitInstance class to include JSON parsing

object RetrofitInstance {

    fun getInstance(): WeatherAPI {
        val retrofit = Retrofit.Builder()
            .baseUrl(BASE_URL)
            .apply {
                    addConverterFactory(
                        Json { ignoreUnknownKeys = true }
                            .asConverterFactory("application/json".toMediaType())
                    )
            }
            .build()

        return retrofit.create(WeatherAPI::class.java)
    }
}
Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: James Taufa