We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The following codec results in an error:
import vulcan.Codec import vulcan.generic.* sealed trait S case class A(i: Int) extends S val c1: Codec[S] = Codec.derive Codec.option(c1).schema // AvroError(org.apache.avro.AvroRuntimeException: Nested union: ["null",[{"type":"record","name":"A","namespace":"avrounion","fields":[{"name":"i","type":"int"}]}]])
However, what I would like is
implicit val optionalUnion: Codec[Option[S]] = { import cats.implicits.catsSyntaxSemigroup implicit val ca: Codec[A] = Codec.derive Codec.union[Option[S]](alt => alt[None.type] |+| alt[Some[A]] ) } optionalUnion.schema /* [ "null", { "type" : "record", "name" : "A", "namespace" : "avrounion", "fields" : [ { "name" : "i", "type" : "int" } ] } ] */
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The following codec results in an error:
However, what I would like is
The text was updated successfully, but these errors were encountered: