Deserialize nested polymorphic json field with json4s
问题 I have a common problem but still couldn't wrap my head around what I was reading around. In a scalatra app, I am receiving the following json: { _type: "hello", timestamp: 123, data: [ {table: "stuffJ",_id: 24}, {table: "preferences",_id: 34,word: "john"} ]} with an unknown number of elements in field 'data'. The field table will always be there to differentiate between class types. I am trying to have it parsed to class RestAPIMessage . This is what I have so far: implicit val jsonFormats =