dtolnay/serde-yaml

from_str::<Value>() interprets entire input as string in some cases

Closed this issue · 1 comments

from_str::<Value>() interprets entire input as string.

fn main() {
    let toml_actually = r#"
presectionfield = 123

[never.valid.yaml]
field = true
otherfield = "string"
"#;
    serde_yaml::from_str::<serde_yaml::Value>(&toml_actually).unwrap_err();
}

Removing the "presectionfield" makes serde_yaml return an error.

This is consistent with the spec as far as I can tell. That input is indeed a valid yaml document containing a single unquoted string.