diff --git a/elastic4s-domain/src/main/scala/com/sksamuel/elastic4s/requests/synonyms/GetSynonymsSetResponse.scala b/elastic4s-domain/src/main/scala/com/sksamuel/elastic4s/requests/synonyms/GetSynonymsSetResponse.scala index 67e70802f..14498d8f3 100644 --- a/elastic4s-domain/src/main/scala/com/sksamuel/elastic4s/requests/synonyms/GetSynonymsSetResponse.scala +++ b/elastic4s-domain/src/main/scala/com/sksamuel/elastic4s/requests/synonyms/GetSynonymsSetResponse.scala @@ -1,3 +1,5 @@ package com.sksamuel.elastic4s.requests.synonyms -case class GetSynonymsSetResponse(count: Int, synonymsSet: Seq[SynonymRule]) +import com.fasterxml.jackson.annotation.JsonProperty + +case class GetSynonymsSetResponse(count: Int, @JsonProperty("synonyms_set") synonymsSet: Seq[SynonymRule]) diff --git a/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/requests/synonyms/SynonymsTest.scala b/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/requests/synonyms/SynonymsTest.scala index a80404c56..490b97516 100644 --- a/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/requests/synonyms/SynonymsTest.scala +++ b/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/requests/synonyms/SynonymsTest.scala @@ -26,8 +26,8 @@ class SynonymsTest extends AnyFlatSpec with Matchers with ElasticDsl with Docker val resp = client.execute { getSynonymsSet("my-synonyms-set") }.await.result - resp.count shouldBe 3 + resp.synonymsSet.map(_.synonyms).toSet shouldBe Set("hello, hi", "bye, goodbye", "test => check") } it should "handle errors" in {