Decompose a case class into JSON.
Decompose a case class into JSON.
Example:
case class Person(name: String, age: Int) implicit val formats = org.json4s.DefaultFormats Extraction.decompose(Person("joe", 25)) == JObject(JField("age",JInt(25)) :: JField("name",JString("joe")) :: Nil)
Decompose a case class into JSON.
Decompose a case class into JSON.
Example:
case class Person(name: String, age: Int) implicit val formats = org.json4s.DefaultFormats Extraction.decompose(Person("joe", 25)) == JObject(JField("age",JInt(25)) :: JField("name",JString("joe")) :: Nil)
Extract a case class from JSON.
Extract a case class from JSON.
org.json4s.JsonAST.JValue#extract
Extract a case class from JSON.
Extract a case class from JSON.
org.json4s.JsonAST.JValue#extract
Flattens the JSON to a key/value map.
Unflattens a key/value map to a JSON object.
Function to extract values from JSON AST using case classes.
See: ExtractionExamples.scala