我有一个Scala 3项目(3.0.0版本),我正在尝试用http4s构建简单的Rest。
我在解码/编码JSON方面有问题。
我正在构建基于http4s.g8的代码。
这个问题发生在这条线上
implicit val jokeDecoder: Decoder[Joke] = deriveDecoder[Joke]编译错误:
对象
deriving.Mirror.Of[com.example.quickstart.Jokes.Joke]中方法deriveDecoder的参数A没有发现deriveDecoder类型的隐式参数。
Scala 3有什么不同之处吗?
我的依赖关系
scalaVersion := "3.0.0"
val Http4sVersion = "0.23.6"
val CirceVersion = "0.14.1"
libraryDependencies ++= Seq(
"org.http4s" %% "http4s-blaze-server" % Http4sVersion,
"org.http4s" %% "http4s-blaze-client" % Http4sVersion,
"org.http4s" %% "http4s-circe" % Http4sVersion,
"org.http4s" %% "http4s-dsl" % Http4sVersion,
"io.circe" %% "circe-core" % CirceVersion,
"io.circe" %% "circe-generic" % CirceVersion
)发布于 2021-11-14 09:56:52
final case class Joke(joke: String) extends AnyVal 就是那个小淘气。把它重写为
final case class Joke(joke: String) 它应该能工作
https://stackoverflow.com/questions/69961089
复制相似问题