jdarais commented on issue #365: URL: https://github.com/apache/avro-rs/issues/365#issuecomment-3731839173
I like the idea of using a union with a record for every variant. You could also represent unit variants as a record with no fields, so no need for a null-type inner field. And tuple variants could be represented as a struct with fields named something like `_1`, `_2`, `_3`, etc, so those would be covered, too. I also like the idea of being able to provide the schema when calling `to_value`, though we might also be able to get away with adding a new function, like `to_value_with_schema<S: Serialize>(value: S, schema: &Schema) -> Result<Value, Error>`, and having the regular `to_value` function just do whatever the schema produced by the derived `AvroSchema` trait would have dictated. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
