将JsonKey解码回Scala案例类时无法映射。
sealed trait Alert
@ConfiguredJsonCodec case class Free(@JsonKey("aa aa") i:Int, j:Int) extends Alert
object Free{
implicit val config: Configuration=Configuration.default
}
val jsonStr = """{"aa aa" : 1, "bankruptcyIndicator" : 0}"""
{
import io.circe.generic.semiauto._
import io.circe.jawn._
implicit val personDec = deriveDecoder[Free]
val person = decode[Free](jsonStr)
println(person)
}
错误Left(DecodingFailure(Attempt to decode value on failed cursor, List(DownField(i))))