Issue with algoliasearch-client-scala retrieving synonyms

synonyms

#1

Trying to use the scala client to retrieve the synonyms we are having some problems because of the “synonym type”.
The point is that the synonym type is coming always in lowercase, but the serializer/deserializer inside the scala client (AbstractSynonymSerializer) seems to expect a camelcase string there defined in “algolia.objects.SynonymType”.

Example of data retrieved for synonym (using api rest or scala client):

{
      "type": "onewaysynonym",
      "input": "DUMMY",
      "synonyms": [
        "dum",
        "dummi"
      ],
      "objectID": "********"
}

And the deserializer inside the client is expecting to read:

object SynonymType {

case object synonym extends SynonymType {
override val name: String = “synonym”
}

case object oneWaySynonym extends SynonymType {
override val name: String = “oneWaySynonym”
}

case object placeholder extends SynonymType {
override val name: String = “placeholder”
}

case object altCorrection1 extends SynonymType {
override val name: String = “altCorrection1”
}

case object altCorrection2 extends SynonymType {
override val name: String = “altCorrection2”
}

}

Because of this the own AlgoliaHttpClient give an error extracting the data…

org.json4s.package$MappingException: unknown error\n\tat org.json4s.Extraction$.extract(Extraction.scala:44)\n\tat org.json4s.ExtractableJsonAstNode.extract(ExtractableJsonAstNode.scala:21)\n\tat algolia.AlgoliaHttpClient$$anon$1.onCompleted(AlgoliaHttpClient.scala:84)\

Can you please review if I am wrong or there is really an issue here? Thanks.