SRobertJames SRobertJames - 3 months ago 42
JSON Question

Scala: Parse JSON directly into a case class

Given a string of JSON, and a case class that corresponds to it, what's a simple way to parse the JSON into the case class? There are many libraries available, but it seems that Scala might now do this out of the box.

What about if the JSON should be parsed into a list of the case class?


Jerkson seems to be abandoned, and I don't want to install the full Play or Lift framework or anything else heavy.


There are several frameworks which can exactly do that.


JSON4s is quite mature and supports jackson or a native JSON-Parser. Used it in many projects to replace jerkson.


Can be used without the full play stack. Great support as part of the play project at typesafe.


A serialization Framework. There is an option to serialize/ and deserialize to JSON.

Spray JSON

Can searialize and deserialize. Need to know number of arguments for deserialization tough.