I fetch a more complex config.xml from jenkins, and distilled it down to this test case.
simplified xml test_failing_description.xml
<?xml version="1.0" encoding="UTF-8"?><project>
<description>
<br/>
Text
</description>
</project>
test
#[rstest]
fn test_failing_description() {
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct SimpleProject {
pub description: String,
}
let d: PathBuf = [
env!("CARGO_MANIFEST_DIR"),
"test_resources",
"jenkins",
"xml",
"job",
"test_failing_description.xml",
]
.iter()
.collect();
let xml = fs::read_to_string(d).expect("Unable to read file");
let jd = &mut quick_xml::de::Deserializer::from_reader(xml.as_bytes());
let job: SimpleProject = serde_path_to_error::deserialize(jd).unwrap();
println!("{:?}", job);
}
I get this error (using serde_path_to_error)
called `Result::unwrap()` on an `Err` value: Error { path: Path { segments: [Map { key: "description" }] }, original: UnexpectedStart([98, 114]) }
I fetch a more complex config.xml from jenkins, and distilled it down to this test case.
simplified xml
test_failing_description.xml
test
I get this error (using
serde_path_to_error
)called `Result::unwrap()` on an `Err` value: Error { path: Path { segments: [Map { key: "description" }] }, original: UnexpectedStart([98, 114]) }
similar issue in
serde-xml-rs
which i am migrating off of. https://github.com/RReverser/serde-xml-rs/issues/215