I am trying to serialize scala case class using json4s with jackson support. But for scenarios where i am trying to mixin traits, it fails to serialize the class. Below is a code example.
trait ISearchKey { var id:String = "" }
When i execute below code i get empty curly brackets, no value serialized, but if i remove trait mixin then CrystalFieldInfo value gets serialized properly
val fld = new CrystalFieldInfo("Field1") with ISearchKey fld.id = "Id1" implicit val formats = Serialization.formats(NoTypeHints) val ser = write[CrystalFieldInfo with ISearchKey](fld) println(ser)
Would appreciate any insight into this problem. Thanks in advance