如果我有嵌套的case类,如何使用spray-json将它们转换为JSON?
例如,我的结构类似于:
case class MyObj1(name: String, myObject2: MyObject2)
case class MyObj2(myObjec3s: Seq[MyObj3])
case class MyObj3(name1: String, name2: String)
The json would look something like:
{
"name": "",
"myObject2": [ { "name1": "", "name2": "" }, { "name1": "", "name2": "" }, .... ]
}