Closed martin-g closed 8 months ago
I wanted to test https://issues.apache.org/jira/browse/AVRO-3946 and I observe a strange behavior.
avro-3946.avsc:
{ "type": "record", "name": "Issue", "namespace": "invalid.example", "fields": [ { "name": "myField", "type": ["long"] } ] }
$ ./target/release/rsgen-avro avro-3946.avsc - #[derive(Debug, PartialEq, Eq, Clone, serde::Deserialize, serde::Serialize)] pub struct Issue { #[serde(rename = "myField")] pub my_field: UnionLong, }
UnionLong enum is not declared! Neither any of the From/TryFrom impls.
UnionLong
From
TryFrom
In addition, I agree with the reporter of https://issues.apache.org/jira/browse/AVRO-3946 that such single type unions should be simplified to non-union, if possible.
Thanks, for reporting this. I have fixed it.
Confirmed! All looks good now!
I wanted to test https://issues.apache.org/jira/browse/AVRO-3946 and I observe a strange behavior.
avro-3946.avsc:
UnionLong
enum is not declared! Neither any of theFrom
/TryFrom
impls.In addition, I agree with the reporter of https://issues.apache.org/jira/browse/AVRO-3946 that such single type unions should be simplified to non-union, if possible.