Skip to content

Commit

Permalink
fix(kotlin): deserialization (generated)
Browse files Browse the repository at this point in the history
algolia/api-clients-automation#3822

Co-authored-by: algolia-bot <[email protected]>
Co-authored-by: Thomas Raffray <[email protected]>
  • Loading branch information
algolia-bot and Fluf22 committed Sep 23, 2024
1 parent 85f3986 commit 906d123
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,9 @@ object RecommendationsHitSerializer extends Serializer[RecommendationsHit] {

case (TypeInfo(clazz, _), json) if clazz == classOf[RecommendationsHit] =>
json match {
case value: JObject => Extraction.extract[TrendingFacetHit](value)
case _ => throw new MappingException("Can't convert " + json + " to RecommendationsHit")
case value: JObject if value.obj.exists(_._1 == "facetName") && value.obj.exists(_._1 == "facetValue") =>
Extraction.extract[TrendingFacetHit](value)
case _ => throw new MappingException("Can't convert " + json + " to RecommendationsHit")
}
}

Expand Down

0 comments on commit 906d123

Please sign in to comment.