Skip to content

Commit 906d123

Browse files
algolia-botFluf22
andcommitted
fix(kotlin): deserialization (generated)
algolia/api-clients-automation#3822 Co-authored-by: algolia-bot <[email protected]> Co-authored-by: Thomas Raffray <[email protected]>
1 parent 85f3986 commit 906d123

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/main/scala/algoliasearch/recommend/RecommendationsHit.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,9 @@ object RecommendationsHitSerializer extends Serializer[RecommendationsHit] {
5252

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

0 commit comments

Comments
 (0)