Citing the manual, "sealed hierarchies are serialized as tagged values, the serialized object tagged with the full name of the instance's class". It works like this:
sealed trait A
case class B(x: Int) extends A
case class C(x: Boolean) extends A
implicit val aW: Writer[A] = Writer.merge(macroW[B], macroW[C])
println(write(s, 2))
Citing the manual, "sealed hierarchies are serialized as tagged values, the serialized object tagged with the full name of the instance's class". It works like this:
Tagged attribute is not the most beautiful, moreover, the package name is hardcoded into Json, making it vulnerable to any refactoring.
Is there an easy way to override the default picklers and achieve the following result?
Thanks! ID: 272 Original Author: kamilkloch