The following code produces differing JSON outputs on Scala 2 and 3:
import zio.json._
sealed trait Parent
object Parent {
case object Child extends Parent
def child: Parent = Child
implicit val codec: JsonCodec[Parent] = DeriveJsonCodec.gen
}
println(Parent.child.toJson)
Scala 2: {"Child":{}}
Scala 3: "Child"
https://scastie.scala-lang.org/WgCoAai8QoeoQ0bbSAeuVg