Я очень плохо знаком с scala (только что узнал на этой неделе) и пытаюсь проанализировать json, используя этот пример
https://medium.com/@djoepramono/how-to-parse-json-in-scala-c024cb44f66b
я добавляю первую часть кода
import io.circe.parser
import io.circe.generic.semiauto.deriveDecoder
case class Staff(name: String)
object SimpleDecoder {
def main(args: Array[String]): Unit = {
val input =
"""
{
"name": "John Doe"
}
""".stripMargin
implicit val staffDecoder = deriveDecoder[Staff]
val decodeResult = parser.decode[Staff](input)
decodeResult match {
case Right(staff) => println(staff.name)
case Left(error) => println(error.getMessage())
}
}
}
это мой pom.xml
<dependency>
<groupId>io.circe</groupId>
<artifactId>circe-core_2.11</artifactId>
<version>0.3.0</version>
</dependency>
<dependency>
<groupId>io.circe</groupId>
<artifactId>circe-generic_2.12</artifactId>
<version>0.12.0-M1</version>
</dependency>
<dependency>
<groupId>io.circe</groupId>
<artifactId>circe-parser_2.12</artifactId>
<version>0.12.0-M1</version>
</dependency>
и когда я запускаю это, я получаю следующую ошибку
Error:(14, 46) could not find Lazy implicit value of type io.circe.generic.decoding.DerivedDecoder[Staff]
implicit val staffDecoder = deriveDecoder[Staff]
Error:(14, 46) not enough arguments for method deriveDecoder: (implicit decode: shapeless.Lazy[io.circe.generic.decoding.DerivedDecoder[Staff]])io.circe.Decoder[Staff].
Unspecified value parameter decode.
implicit val staffDecoder = deriveDecoder[Staff]
Error:(15, 44) could not find implicit value for parameter d: io.circe.Decoder[Staff]
val decodeResult = parser.decode[Staff](input)
Error:(15, 44) not enough arguments for method decode: (implicit d: io.circe.Decoder[Staff])cats.data.Xor[io.circe.Error,Staff].
Unspecified value parameter d.
val decodeResult = parser.decode[Staff](input)
Error:(17, 42) value name is not a member of Any
case Right(staff) => println(staff.name)
Error:(18, 41) value getMessage is not a member of Any
case Left(error) => println(error.getMessage())