Can';我找不到ScalaSig
我正在尝试使用RequestContext.complete和Promise[RouterResult]完成http请求,但出现错误:Can';我找不到ScalaSig,scala,akka-http,json4s,Scala,Akka Http,Json4s,我正在尝试使用RequestContext.complete和Promise[RouterResult]完成http请求,但出现错误: org.json4s.package$MappingException:找不到类akka.http.scaladsl.marshalling.ToResponseMarshallable$$anon$1的ScalaSig 这是我的密码: def r: RequestContext def p: Promise[RouteResult] de
org.json4s.package$MappingException:找不到类akka.http.scaladsl.marshalling.ToResponseMarshallable$$anon$1的ScalaSig
这是我的密码:
def r: RequestContext
def p: Promise[RouteResult]
def complete(status: StatusCode, obj: => ToResponseMarshallable) = {
val f = status match {
case AkkaStatusCodes.NoContent =>
r.complete(status, None)
case _ =>
r.complete(status, obj)
}
f.onComplete(p.complete(_))
stop(self)
}
您的代码片段不可复制。Json4s使用解析缩放。这可能是一个类似于bug或其他的东西。注意:!