diff --git a/app/src/main/java/gq/kirmanak/mealie/data/impl/RetrofitBuilder.kt b/app/src/main/java/gq/kirmanak/mealie/data/impl/RetrofitBuilder.kt index 2ddadff..fcdc9ea 100644 --- a/app/src/main/java/gq/kirmanak/mealie/data/impl/RetrofitBuilder.kt +++ b/app/src/main/java/gq/kirmanak/mealie/data/impl/RetrofitBuilder.kt @@ -10,13 +10,16 @@ import javax.inject.Inject @ExperimentalSerializationApi class RetrofitBuilder @Inject constructor(private val okHttpBuilder: OkHttpBuilder) { + private val json by lazy { Json { coerceInputValues = true } } + fun buildRetrofit(baseUrl: String, token: String? = null): Retrofit { Timber.v("buildRetrofit() called with: baseUrl = $baseUrl, token = $token") val contentType = "application/json".toMediaType() + val converterFactory = json.asConverterFactory(contentType) return Retrofit.Builder() .baseUrl(baseUrl) .client(okHttpBuilder.buildOkHttp(token)) - .addConverterFactory(Json.asConverterFactory(contentType)) + .addConverterFactory(converterFactory) .build() } } \ No newline at end of file diff --git a/app/src/main/java/gq/kirmanak/mealie/data/recipes/network/GetRecipeSummaryResponse.kt b/app/src/main/java/gq/kirmanak/mealie/data/recipes/network/GetRecipeSummaryResponse.kt index aa64fc2..6a59b25 100644 --- a/app/src/main/java/gq/kirmanak/mealie/data/recipes/network/GetRecipeSummaryResponse.kt +++ b/app/src/main/java/gq/kirmanak/mealie/data/recipes/network/GetRecipeSummaryResponse.kt @@ -11,7 +11,7 @@ data class GetRecipeSummaryResponse( @SerialName("name") val name: String, @SerialName("slug") val slug: String, @SerialName("image") val image: String, - @SerialName("description") val description: String, + @SerialName("description") val description: String = "", @SerialName("recipeCategory") val recipeCategories: List, @SerialName("tags") val tags: List, @SerialName("rating") val rating: Int?,