In a short note, YAML files represent configuration data in most of the times. According to Wikipedia: YAML "is a human-friendly data serialization standard for all programming languages". Basically we can say that is similar to XML and JSON notation and it is pretty used on DevOps activities for IaC configurations and for sharing data across multiple applications.
-
key-Value Pair: there's nothing more to say to this. You have a "Key" that acts as an Identification for value itself.
Here's an example:
Key: Value
-
Array and Lists: is the same data structure, just like any programming language.
Here's an example:
Fruits:
- Apple
- Orange
- Banana
-
Dictionaries and Maps: it is a common data structure equivalent to a hash map
Here's an example:
Fruits:
Cal : 104
For this structure is very important the usage of blank spaces for hierarchy purposes (indentation)
A typical dictionary example is a
Car
with multiple internal properties represented byKey-Value pair
representation, but aParking lot
example is represented by a couple of dictionaries.
- Properties can be defined without any order
- For arrays, item order matter
- In case of having two dictionaries, they will be considered the same if their properties are equal without an order
- The
#
is for comments
Thank you for this useful summary! @davidlares and @f2ka07 🙌