akka-http-test icon indicating copy to clipboard operation
akka-http-test copied to clipboard

XML output from Marshaller

Open dantodor opened this issue 9 years ago • 1 comments

I think there might be a problem with the array marshaller. If you call the endpoint with "Accept: application/xml" , the XML response is syntactically correct, but the result is doubled. My guess would be replacing this:

Source.fromIterator(() ⇒ persons.iterator).mapAsync(1) { person ⇒
            Marshal(persons.map(person ⇒ PersonV2(person.name, person.age, person.married))).to[NodeSeq]
          }.map(ns ⇒ ByteString(ns.toString))

with this:

Source.fromIterator(() ⇒ persons.iterator).mapAsync(1) { person ⇒
            Marshal(PersonV2(person.name, person.age, person.married)).to[NodeSeq]
          }.map(ns ⇒ ByteString(ns.toString))

Basically I think you're going through the same iterator twice :)

dantodor avatar May 31 '16 10:05 dantodor

Thanks for notifying me about this issue. I will look into it!

dnvriend avatar Jun 02 '16 10:06 dnvriend