Default
Default and recommended ADT encoding strategy. Encodes the ADT super type as a single-element map with the only member consisting of the type ID as key and the instance encoding as the value.
Example:
A Dog
instance from this ADT:
sealed trait Animal
case class Dog(age: Int, name: String) extends Animal
case class Cat(weight: Double, color: String, home: String) extends Animal
case class Mouse(tail: Boolean) extends Animal
would be encoded as such, for example:
{
"Dog" : {
"age": 2,
"name": "Lolle"
}
}