The following example ADT fails to derive the Encoder for Foo but can generate the Decoder. Changing this to use generic.semiauto works. This uses the latest 0.13.0-M4 release.
import io.circe._
import io.circe.derivation._
sealed trait Foo {
def id: String
}
object Foo {
// could not find implicit value for parameter instance: io.circe.Encoder.AsObject[Bar]
implicit val encoder: Encoder[Foo] = deriveEncoder[Foo]
implicit val decoder: Decoder[Foo] = deriveDecoder[Foo]
}
final case class Bar (
id: String
) extends Foo
object Bar {
implicit val encoder: Encoder[Bar] =
deriveEncoder[Bar]
implicit val decoder: Decoder[Bar] =
deriveDecoder[Bar]
}
final case class Baz(
id: String
) extends Foo
object Baz {
implicit val encoder: Encoder[Baz] = deriveEncoder[Baz]
implicit val decoder: Decoder[Baz] = deriveDecoder[Baz]
}
The following example ADT fails to derive the Encoder for Foo but can generate the Decoder. Changing this to use generic.semiauto works. This uses the latest 0.13.0-M4 release.