Thanks for your patience and posting the reproducer, makes it much easier to find what's wrong :)
There is one small typo basically, you need to provide a *ToEntityMarshaller* and not a To*Response*Marshaller. Think of it this way, you should provide the "most basic" marshaller and then the more complex ones will be derived from the simple one. So here you really render just the Entity, not the entire Response, so that's what you should provide. The multiple "entities" are separated by the framing you picked and this way you get what you wanted - a json array framed list of strings for example. In my blog http://kto.so/2016/04/10/hakk-the-planet-implementing-akka-http-marshallers/ i explained a bit how you can go about debugging "which marshaller" is missing, so perhaps this would have helped you here a bit too. Cheers, have a nice weekend! On Wed, Mar 1, 2017 at 5:04 PM, Edmondo Porcu < [email protected]> wrote: > Hello everyone, > > what is required to get the following compile? > > class TestUnmarshalling{ > > sealed trait Xor[+A,+B] > object Xor{ > def left[A,B](a:A):Xor[A,B] = Left(a) > def right[A,B](b:B):Xor[A,B] = Right(b) > } > > case class Left[A] (a:A)extends Xor[A,Nothing] > case class Right[B](b:B) extends Xor[Nothing,B] > > implicit val actorSystem = ActorSystem() > implicit val actorMaterializer = ActorMaterializer() > > implicit val xorMarshallers:ToResponseMarshaller[Xor[Throwable,String]] > = ??? > > private val routes = path("pippo") { > pathEnd { > get { > complete(Xor.left[Throwable, String](new > NullPointerException("hello world"))) > } ~ > post { > implicit val streamingSupport = EntityStreamingSupport.json() > val s = Source.single(Xor.left[Throwable, String](new > NullPointerException("hello world"))) > complete(s) > } > } > } > > > } > > The get part of the route compile, the post doesn't. It looks like the > toResponseMarshaller isn't enough to get that source to marshal? > > Thanks > > Edmondo > > -- > >>>>>>>>>> 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 https://groups.google.com/group/akka-user. > For more options, visit https://groups.google.com/d/optout. > -- Cheers, Konrad 'ktoso' Malawski Akka <http://akka.io/> @ Typesafe <http://typesafe.com/> -- >>>>>>>>>> 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 https://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.
