1

I'm looking for a good json library. I already experienced with lift's json library but wasn't satisfies.. Also saw Play's json library and it looks good, but I don't feel comfortable with mixing such a big library in our project...

What do you think about using Play's json library in a Play free project? Can you recommend a good json library?

tckmn
  • 57,719
  • 27
  • 114
  • 156
  • SO similar question http://stackoverflow.com/questions/8054018/json-library-for-scala, in this answer you have many suggested libraries http://stackoverflow.com/a/14442630/833336 – emecas Mar 17 '13 at 12:11

4 Answers4

6

I would recommend also the standalone JSON library from Play. It is easy to use and the most customizable library for JSON I know.

https://github.com/fooblahblah/play-json

Ghashange
  • 1,027
  • 1
  • 10
  • 20
4

We had success with spray-json, it is fairly straight-forward to define custom deserializations into arbitrarily deep case class structures.

https://github.com/spray/spray-json

Chris
  • 51
  • 2
2

What you don't like into lift-json?

In my opinion you should look into json4s:

https://github.com/json4s/json4s

That you'll be able to choose an other implementation if needed in future.

Alois Cochard
  • 9,812
  • 2
  • 29
  • 30
1

Jackson's scala moduel has been the best option for me. The api's are relatively the same from the Java versions. And you can use it to serialize/deserialize mixed java/scala types. https://github.com/FasterXML/jackson-module-scala

Play json has some really cool features like xpath style selectors for working with json types. But, it just dosent work out of the box for any custom types other than the standard collections and types. You have to write a lot of cruft code to make all that work and I found this party pretty cumbersome.

smartnut007
  • 6,324
  • 6
  • 45
  • 52
  • We did a comparative benchmark of lift-json vs Jackson/Jerkson. The latter was about twice as fast. But lift-json allows the incoming or outgoing types to be transmuted (e.g. parsing or formatting of dates); this extra feature probably accounts for the worse performance. – Rick-777 Mar 18 '13 at 22:51