tengo el siguiente codigo para consumir datos desde la api de edamam pero me al correra la app me lanza el error de Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2 path $ alguien me dice que puedo hacer para solucionarlo por favor
val retrofit: Retrofit = Retrofit.Builder()
.baseUrl(url)
.addConverterFactory(GsonConverterFactory.create())
.build()
val service:ApiService = retrofit.create<ApiService>(ApiService::class.java)
service.getAllRecipe("bread",app_id,app_key).enqueue(object : Callback<List<Recipe>>{
override fun onResponse(
call: Call<List<Recipe>>, response: Response<List<Recipe>>?) {
val recetas = response!!.body()
Log.i(TAG, Gson().toJson(recetas))
}
class Recipe {
private var uri:String? = null
private var label:String? = null
private var image:String? = null
private var source:String? = null
private var url:String? = null
private var yield:Int = 0
private var calories:Float = 0f
private var totalNutrients:String? = null
private var totalDaily:String? = null
}