serde-xml-rs
serde-xml-rs copied to clipboard
Can't handle duplicate field between TAG and Attribute
The following XML data result in "Error: duplicate field fragments"
<?xml version="1.0" encoding="UTF-8"?> <output_message timezone="UTC" id="3200" repeat="0" fragments="1"> <fragments> <fragment cycle="0" frame="11" /> </fragments> </output_message>
input struct is:
#[derive(Debug, Deserialize)] pub struct OutputMessage { pub timezone: String, pub id: String, pub repeat: String, #[serde(rename = "fragments", default)] pub nr_of_fragments: String, pub fragments: Fragments, }
#[derive(Debug, Deserialize)] pub struct Fragments { pub fragment: Vec<Fragment>, }
#[derive(Debug, Deserialize)] pub struct Fragment { pub cycle: String, pub frame: String, }