Fix parsing of null descriptions
This commit is contained in:
@@ -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()
|
||||
}
|
||||
}
|
||||
@@ -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<String>,
|
||||
@SerialName("tags") val tags: List<String>,
|
||||
@SerialName("rating") val rating: Int?,
|
||||
|
||||
Reference in New Issue
Block a user