Closed ephraimkunz closed 3 years ago
I have some XML like this I want to deserialize:
<gedcomx> <place> <name>Chestnut Grove, New Kent, Virginia, United States</name> </place> </gedcomx>
This XML could also contain another nested place tag, like this:
place
<gedcomx> <place> <name>Chestnut Grove, New Kent, Virginia, United States</name> <place resource="www.wikipedia.org"> </place> </gedcomx>
I have these Rust structs:
#[derive(YaDeserialize, Default, Debug)] struct Gedcomx { #[yaserde(rename = "place")] places: Vec<PlaceDescription>, } #[derive(YaDeserialize, Default, Debug)] struct PlaceDescription { place: Option<ResourceReference> name: String, } #[derive(Debug, YaDeserialize, Default)] pub struct ResourceReference { #[yaserde(attribute)] pub resource: String, }
However I'm not able to deserialize this correctly. When I try on the first or the second XML example I get:
Gedcomx { places: [ PlaceDescription { place: Some( ResourceReference { resource: "", }, ), name: "", }, ], }
Looks similar to #76.
I have some XML like this I want to deserialize:
This XML could also contain another nested
place
tag, like this:I have these Rust structs:
However I'm not able to deserialize this correctly. When I try on the first or the second XML example I get: