给定以下简单的yaml数据,
foo: 1
bar:
- one
- two
如果我想创建一个与原始数据结构完全相同的数组,正确的方法是什么?
我已经尝试过:
first:
foo: 1
bar:
- one
- two
- three
second:
foo: 2
bar:
- one1
- two2
- three3
或者,
- foo: 1
bar:
- one
- two
- three
- foo: 2
bar:
- one1
- two2
- three3
并且,此外,
- first:
foo: 1
bar:
- one
- two
- three
- second:
foo: 2
bar:
- one1
- two2
- three3
但似乎没有正确的方式。有什么帮助吗?谢谢!