You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But, the fact that I have a union where one type is not a primitive type (i.e. a record), seems to return "unsupported Union" errors when trying to deserialize (it builds the schema just fine, apparently).
Why isn't this supported? Wouldn't it be easy to just have the Record type run a recursive parser on the body underneath?
Edit:
I found some code in deserialize struct that has:
match *self.input {
Value::Record(ref fields) => visitor.visit_map(StructDeserializer::new(fields)),
Value::Union(ref inner) => match **inner {
Value::Record(ref fields) => visitor.visit_map(StructDeserializer::new(fields)),
_ => Err(de::Error::custom("not a record")),
},
_ => Err(de::Error::custom("not a record")),
}
Is this saying that I have to deserialize unions with records straight into a struct (or, I assume, an Option to handle unions with "null"?)? So, basically, skip the enum in the deserialized data structure and go straight to the one variant that matches the struct?
The text was updated successfully, but these errors were encountered:
As far as I know, the following schema is perfectly acceptable in avro:
But, the fact that I have a union where one type is not a primitive type (i.e. a record), seems to return "unsupported Union" errors when trying to deserialize (it builds the schema just fine, apparently).
Looking at the code, it indeed has:
in the deserialize code (deserialize_any).
Why isn't this supported? Wouldn't it be easy to just have the Record type run a recursive parser on the body underneath?
Edit:
I found some code in deserialize struct that has:
Is this saying that I have to deserialize unions with records straight into a struct (or, I assume, an Option to handle unions with "null"?)? So, basically, skip the enum in the deserialized data structure and go straight to the one variant that matches the struct?
The text was updated successfully, but these errors were encountered: