dtolnay / serde-yaml

Strongly typed YAML library for Rust

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

how can I merge 2 serde_yaml::Value?

Masber opened this issue · comments

Dear serde_yaml community,

how can I merge 2 serde_yaml::Value?

eg

# yaml 1
---
value_1: 1
value_2:
  value_2_1: 21
  value_2_2: 22
value_3:
  - 1
  - 2
  - 3

and

# yaml 2
---
value_1: 10
value_2:
  value:2:1: 2
value_3:
  - 10
  - 20
  - 30

Would result in

# result
---
value_1: 10
value_2:
  value_2_1: 2
  value_2_2: 22
value_3:
  - 10
  - 20
  - 30

thank you