serde-xml-rs icon indicating copy to clipboard operation
serde-xml-rs copied to clipboard

Can't handle duplicate field between TAG and Attribute

Open Rutger798 opened this issue 7 years ago • 0 comments

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, }

Rutger798 avatar Apr 25 '18 08:04 Rutger798