Convert a JSON string to a T
, where T
is some context bound type.
Convert a JSON string to a T
, where T
is some context bound type.
a context bound type
the JSON string
a scala.util.Try that is either the object of type T
, or one of
java.io.IOException, com.fasterxml.jackson.core.JsonParseException,
or com.fasterxml.jackson.databind.JsonMappingException
Convert an object to a JSON string representation.
Convert an object to a JSON string representation.
the object to convert
a scala.util.Try that is either the JSON string representation, or a com.fasterxml.jackson.core.JsonProcessingException
Created by awharris on 1/17/14.
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.