0

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!

user2926523
  • 453
  • 1
  • 5
  • 8

1 Answers1

0

Found this package that partially solved my problem, but need to manually define json schema for it to work

user2926523
  • 453
  • 1
  • 5
  • 8