I am using jackson for json deserializing in Scala.
I am trying to deserialize a json field which could either be a string or an object of a class that I have defined. For example:
{
fieldName: "something"
/*** OR ****/
fieldName: Object of case class Sample(..........)
}
How do I deal with such a case and let Json automatically deserialize into a string or an object of the case class above depending on the input value.