Yes I do have an implicit actor materializer in scope On Thu, 23 Jul 2015 6:54 pm Heiko Seeberger <[email protected]> wrote:
> Do you have an implicit Materializer in scope? > > Heiko > > -- > > *Heiko Seeberger* > Home: heikoseeberger.de > Twitter: @hseeberger <https://twitter.com/hseeberger> > Public key: keybase.io/hseeberger > > On 23 Jul 2015, at 15:25, Kabir Idris <[email protected]> wrote: > > Hi all, Im facing the same error in akka-http 1.0 > > > > On Monday, March 16, 2015 at 12:16:37 AM UTC+1, Arthur Kushka wrote: >> >> Hi. I was faced with a typical error with spray-json and akka-http that >> easy to find in Google, but none of solutions helps me. >> >> Scala fail compiling in place where I parsing request body with `entity` >> directive. As error say, they can`t find implicit value for unmarshaller, >> but formatter and `SprayJsonSupport` are present in context (in >> documentation written that that`s enough). >> >> Below is compiler message and my code. >> Please help me with finding solution of this problem. >> >> [error] /home/arhelmus/techmedia/akka-http/src/main/scala/utils/ >> CustomDirectives.scala:31: could not find implicit value for parameter um >> : akka.http.unmarshalling.FromRequestUnmarshaller[utils.Credentials] >> [error] entity(as[Credentials]).flatMap { credentials => >> >> >> package utils >> >> import akka.http.marshallers.sprayjson.SprayJsonSupport >> import akka.http.server.Directive1 >> import models.User >> import spray.json._ >> >> case class Credentials(login: String, password: String) >> >> trait Protocols extends DefaultJsonProtocol { >> implicit val formatter: RootJsonFormat[Credentials] = jsonFormat2( >> Credentials.apply) >> } >> >> object CustomDirectives extends CustomDirectives >> >> trait CustomDirectives extends SprayJsonSupport with Protocols { >> >> import akka.http.server.directives.BasicDirectives._ >> import akka.http.server.directives.MarshallingDirectives._ >> import akka.http.server.directives.ParameterDirectives._ >> >> def authenticateByToken: Directive1[User] = >> parameter("token").flatMap { code => >> provide(User(code, "asdsada", "asdsadasd")) >> } >> >> def authenticateByCredentials: Directive1[User] = { >> entity(as[Credentials]).flatMap { credentials => >> provide(User(credentials.login, credentials.login, credentials. >> password)) >> } >> } >> >> } >> > > -- > >>>>>>>>>> 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. > > -- > >>>>>>>>>> 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 a topic in the > Google Groups "Akka User List" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/akka-user/Vhm_zkTajJk/unsubscribe. > To unsubscribe from this group and all its topics, 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. > -- >>>>>>>>>> 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.
