Hello,
I've got the following code that produces the error: too many arguments for
method formFields: (pdm:
akka.http.scaladsl.server.directives.FormFieldDirectives.FieldMagnet)pdm.Out
object Json {
val sj = ScalaJack()
val vc = VisitorContext(hintMap = Map("default" -> "type"))
def fromJson[T](json: String)(implicit tag: TypeTag[T]) = sj.read[T](json,
vc)
def toJson[T](value: T)(implicit tag: TypeTag[T]): String =
sj.render[T](value, vc)
object AkkaSupport {
implicit def defaultJsonUnmarshaller[T](implicit fm: Materializer, tag:
TypeTag[T]): FromEntityUnmarshaller[T] =
PredefinedFromEntityUnmarshallers.stringUnmarshaller.map(fromJson[T])
}
}
import Json.AkkaSupport._
path("dms" / "messages" / "direct" / Segment ) { intentKey =>
formFields( 'data.as[Map[String,Any]], 'policy.as[MessagePolicy].? ) {
(data,policy) =>
complete("Ok")
}
}
If I try without my unmarshaller like the following, then it compiles fine:
formFields( 'data.as[Map[String,Any]], 'policy.? ) { (data,policy) =>
Any idea why its not working? * I do have an implicit Materializer and
ExecutionContext in scope.*
Greg
--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ:
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.