tafia / quick-xml

Rust high performance xml reader and writer
MIT License
1.18k stars 235 forks source link

Deserialize array failed when tags discontinuous #809

Closed Caisin closed 3 days ago

Caisin commented 3 days ago

this code will Deserialize fail

#[derive(Debug, Serialize, Deserialize)]
pub struct TestDeErr {
    b: Vec<String>,
    c: String,
}
#[test]
fn test_de_err() -> anyhow::Result<()> {
    let o = quick_xml::de::from_str::<TestDeErr>(
        r#"
        <a>
            <b>b</b>
            <c>c</c>
            <b>b</b>
        </a>
        "#,
    )?;

    println!("{o:#?}");

    Ok(())
}
Error: duplicate field `b`
Mingun commented 3 days ago

Enable overlapped-lists feature.