我想创建一个带有 circe 的 Json 对象,其中值可以是字符串或列表,例如:
val param = Map[String, Map[String, Object]](
"param_a" -> Map[String, Object](
"param_a1" -> "str_value",
"param_a2" -> List(
Map[String, String](
"param_a2.1" -> "value_2.1",
"param_a2.2" -> "value_2.2")
)
),
但是,如果我这样做
param.asJson
它失败了
Error:(61, 23) could not find implicit value for parameter encoder: io.circe.Encoder[scala.collection.immutable.Map[String,Map[String,Object]]]
.postData(param.asJson.toString().getBytes)