I am trying to encode a Map to Json using io.cierce
My Json data is like
{
"key" : "123-456" ,
"message" : "test msg",
"payload" : { "hello" : "world" }
}
And Json conversion
Map(
"key" -> root.key.string.getOption(data).getOrElse(""),,
"message" -> root.message.string.getOption(data).getOrElse(""),
"payload" -> root.payload.json.getOption(data).getOrElse(Json.Null)
) asJson
But this is resulting could not find implicit value for parameter encoder: io.circe.Encoder[scala.collection.immutable.Map[String,java.io.Serializable]] ) asJson)
I was under the impression import io.circe.generic.auto._ should take care of most of the encoding