Implicit conversions from an arbitrary JSON object to a variety of object types.
Implicit conversions from an arbitrary JSON object to a variety of object types.
import com.paypal.cascade.json._ case class JsonPatch(op: String, path: String, value: Option[Any]) case class AnObject(...) val jsonStr = JsonPatch("add", "/-", Some(AnObject(...)))).toJson.get val a = jsonStr.fromJson[JsonPatch].get val inner = a.value.convertValue[Option[AnObject]].get
Implicit conversions from a given object of type T
to a JSON String
Implicit conversions from a given object of type T
to a JSON String
import com.paypal.cascade.json._ case class AnObject(v1: String, v2: Long, v3: List[String]) val a = AnObject("value", 5L, List("hi", "there") a.toJson
the type of this object
Implicit conversions from a JSON String to a variety of object types.
Implicit conversions from a JSON String to a variety of object types.
import com.paypal.cascade.json._ """{"key":"value"}""".toMap
Patterns adapted from https://coderwall.com/p/o--apg
Patterns adapted from https://coderwall.com/p/o--apg
Known caveats:
null
is a valid JSON value. Case classes that will
be serialized/deser'd need to include their own validation to guard against unintentional nulls.
Convenience implicits for reading objects from and writing objects to JSON Strings