I've noticed this explanation in docs, but wasn't sure if this is a general suggestion always to order union schemas when defining them using Avro4s. I ran a test simulating an order swap between two records in union and haven't noticed any issues with de/serializing them both ways. Is this difference only affects how those schemas appear in .avsc files or I'm missing something?
Put aside that null should be first, and this is enforced by Option.
The order of types in a union is significant in Avro, e.g the schemas type: ["int", "float"] and type: ["float", "int"] are different. This can cause problems when generating schemas for sealed trait hierarchies. Ideally we would generate schemas using the source code declaration order of the types.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Hey,
I've noticed this explanation in docs, but wasn't sure if this is a general suggestion always to order union schemas when defining them using Avro4s. I ran a test simulating an order swap between two records in union and haven't noticed any issues with de/serializing them both ways. Is this difference only affects how those schemas appear in .avsc files or I'm missing something? Put aside that null should be first, and this is enforced by Option.
Thanks!