Skip to content

Known Issues - Json Converter

Scala 2

Under scala 2 the json converter have some issues with the json parser and the Any Class in toJson Method and needs an explicit cast to Any. Circe does not support this format by default.

For scala 3 you can ignore this issue.

scala
val isScala3 = scala.util.Properties.versionNumberString.startsWith("3.")
val jString3: String = if (isScala3) {
  jsonConverter.toJson(HelloWorld3("servus", "welt"))
}
else {
  jsonConverter.toJson(HelloWorld3("servus", "welt").asInstanceOf[Any])
}
assertEquals(jString3, "{\"greetings\":\"servus\",\"name\":\"welt\"}")

Released under the Apache License 2.0.