Open christophercurrie opened 11 years ago
Adding my $0.02. Salat has a very useful ability for traits where it supplies a type hint in the generated JSON when serializing a class for a trait-type. So, for example:
@someAnnotationHere trait X case class Y( val a:String )
case class Target( foo: X ) val t = Target( Y("wow") )
When serializing t you would get something like: {"foo":{"_th":"com.something.Y","a":"wow"}}
The type hint would then be used during deserialization, because of course you'd have no other way to know that the 'X' type is actually a Y and not a Z or something else.
As discussed in #77, it would be helpful if there were a way to ignore all the implemented fields and methods of a trait used by a class.