Given the following simple yaml data,
foo: 1
bar:
- one
- two
if I want to create an array of the exact same data structure, what's the correct way?
I've tried
first:
foo: 1
bar:
- one
- two
- three
second:
foo: 2
bar:
- one1
- two2
- three3
or,
- foo: 1
bar:
- one
- two
- three
- foo: 2
bar:
- one1
- two2
- three3
and also,
- first:
foo: 1
bar:
- one
- two
- three
- second:
foo: 2
bar:
- one1
- two2
- three3
but none seems to be the correct way. Any help? Thanks!
I think you're after either this:
Which gives you this structure:
Or this if the 'first' and 'second' labels are important to you:
Which gives you a dictionary/associative array: