We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 85f3986 commit 906d123Copy full SHA for 906d123
src/main/scala/algoliasearch/recommend/RecommendationsHit.scala
@@ -52,8 +52,9 @@ object RecommendationsHitSerializer extends Serializer[RecommendationsHit] {
52
53
case (TypeInfo(clazz, _), json) if clazz == classOf[RecommendationsHit] =>
54
json match {
55
- case value: JObject => Extraction.extract[TrendingFacetHit](value)
56
- 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)
57
+ case _ => throw new MappingException("Can't convert " + json + " to RecommendationsHit")
58
}
59
60
0 commit comments