akka / akka-http

The Streaming-first HTTP server/module of Akka
https://doc.akka.io/docs/akka-http
Other
1.34k stars 596 forks source link

Akka Http Documentation is missing in JSON support for using jackson. It would be help to provide examples for jackson #2528

Open rajeshreddykundur opened 5 years ago

rajeshreddykundur commented 5 years ago
TimMoore commented 5 years ago

There are docs on using JSON with Jackson here: https://doc.akka.io/docs/akka-http/current/common/json-support.html

Is that what you mean or is there something else missing?

rajeshreddykundur commented 5 years ago

In the docs for Scaladsl only Spray examples are provided, Jackson examples are missing and in the akka-http-tests too examples for Scala Jackson aren’t there. If you have any Jackson examples with Scala for Unmarshalling should be good.

raboof commented 5 years ago

Indeed traditionally we have recommended spray-json for Scala and Jackson for Java.

I wonder if we should be recommending https://github.com/hseeberger/akka-http-json with some examples more prominently - that also supports Jackson. Does that work for you?

rajeshreddykundur commented 5 years ago

Thank you @TimMoore and @raboof for responding quickly.

I would like to understand, why was spray-json recommended for Scala and Jackson for Java? Is there any specific reason Jackson only works best with Java?

raboof commented 5 years ago

spray-json has some additional features that makes it especially nice to use from Scala compared to Jackson, such as support for case classes and providing implicits.

ennru commented 3 years ago

It makes sense to show both Jackson and Spray JSON in the Scala-variant of the docs.

jrudolph commented 3 years ago

It makes sense to show both Jackson and Spray JSON in the Scala-variant of the docs.

I don't agree with that. In many regards, Jackson is a hack to make mapping POJOs to JSON feasible in Java. It's not needed or recommended to be used from Scala. There are superior solutions available for Scala (spray-json is not the best or most modern option any more, so we might consider showing something different here).

rajeshreddykundur commented 3 years ago

@jrudolph Need suggestion on examples of the most superior solutions in Scala, also whats the timeframe for updating the docs, examples with those. It will be very helpful for adoption.