I am trying to understand very basic concept of YAML. I didn't find any relevant documentation which can clear my doubts. For example:
product:
- sku : BL394D
quantity : 4
description : Basketball
price : 450.00
- sku : BL4438H
quantity : 1
description : Super Hoop
price : 2392.00
tax : 251.42
total: 4443.52
product
is, I guess, a sequence with:
- sku : BL394D
As data. I have read that in YAML you can define a sequence as:
name:
-a
-b
-c
My question is that in product
sequence what are these values? They do not have a hyphen in front of them as items of sequence has.
quantity : 4
description : Basketball
price : 450.00
Do they also belong to sequence or are nested key: value
pairs for sku
? I am totally confused. Help me understand the very basic syntax with example of list, maps and nesting lists inside maps and vice-versa.
product
is a sequence of two maps, each of them containing a sku
, a quantity
, a description
and a price
entry.
You can find some examples and description here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With