dtolnay / serde-yaml

Strongly typed YAML library for Rust
Apache License 2.0
964 stars 164 forks source link

`apply_merge` doesn't merge recursively #362

Open victordidenko opened 1 year ago

victordidenko commented 1 year ago
let yaml_string = "\
a: &a
  a: a
b: &b
  <<: *a
c:
  - <<: *a
  - <<: *b
";
let mut yaml: serde_yaml::Value = serde_yaml::from_str(yaml_string).unwrap();
yaml.apply_merge().unwrap();
println!("{}", serde_yaml::to_string(&yaml).unwrap());

outputs

a:
  a: a
b:
  a: a
c:
- a: a
- <<:
    a: a

while it should be

a:
  a: a
b:
  a: a
c:
- a: a
- a: a