zio / zio-schema

Compositional, type-safe schema definitions, which enable auto-derivation of codecs and migrations.
https://zio.dev/zio-schema
Apache License 2.0
142 stars 162 forks source link

Correctly encode and decode wrapper for Avro Union #659

Closed pablf closed 9 months ago

pablf commented 9 months ago

/claim #608

The problem was that a Schema corresponding to an Avro Union will get wrapped in an Avro Record to avoid two nested Avro Unions. So this should fix the problem for the cases when Optional, Either or Enum is wrapping one another (and further nesting).

Also, I think that the test suite for the Avro codec need further work. Changing the current test suite to cover all cases using generators, like in the other codecs, might uncover some bugs.