Open rajeshreddykundur opened 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?
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.
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?
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?
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.
It makes sense to show both Jackson and Spray JSON in the Scala-variant of the docs.
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).
@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.