I'm new to scala and I encountered a problem to validate free style json vs my predefined case class, assume:
case class sth(f1: String,
f2: Option[String],
f3: Map[String, sth2],
f4: Array[sth2],
)
case class sth2(subF1: String, subF2: List[sth3])
case class sth3(subF:String)
I tried Java 8 jackson validator describe in here, but how do I define nested case class (within Map and Array) and throw custom exception message?
Many thanks in advance for any answer!