I am working on a complex json build that pulls data from a database and is required to build the data into a complex structure of json after a little data manipulation. I have case classes, or models, that I must follow in order for the data to be processed by the java service application. So far I have been unable to find any resource on the web that shows this complex of a data structure. Looking for a direction to start in to generate this json structure given is a small sample of the model with the parent being WatchModel:
case class WatchModel(watchId: String,
case class Person(addresses: Array[Address],
case class Name(firstName: String, middleName: String, lastName: String)
Also, these are pulled using spark so I have everything pulled into datasets and all of the minor models are matched too, but I have been unable to construct the parent model.