0

What is this yaml structure from the file invoice.yaml?

items:
    - part_no:   A4786
      descrip:   Water Bucket (Filled)
      price:     1.47
      quantity:  4

    - part_no:   E1628
      descrip:   High Heeled "Ruby" Slippers
      size:      8
      price:     133.7
      quantity:  1

If items were a list each line would would start with a dash. The lines without a dash would be key:value pairs in the items dictionary. But what is the line with the dash, a list of one key:value pair? I don't see the point of that.

I've seen this structure in lots of YAML files for configuring k8s or cloud, but none of the docs or examples I can find explain what this structure is.

Thanks.

Dean Schulze
  • 8,815
  • 19
  • 85
  • 143

1 Answers1

0

Found a very good answer here. The items is a list of mappings. In JSON items would be an array of objects.

Dean Schulze
  • 8,815
  • 19
  • 85
  • 143