Open Laboratory for Technocrats

Grab the developer role, learn concepts & prepare with senior software engineers to get solutions for problems in a software job. Coding and Programming Solutions crafted for you.

YAML - Beginners Guide






It was originally called yet another markup language because it came at a time when
there were a lot of markup languages being introduced such as HTML, XML, and so on but YAML is much more than a markup language and that's why the name was changed to YAML

So what is YAML?

YAML is a data serialization language similar to JSON and XML which is used to store and represent the data you might have seen used in GitHub actions, docker, Kubernetes, and a lot of other DevOps tools.

They use YAML files for the configuration files. They have the extension of dot yml or dot yaml and a file can consist of multiple different things.

In this article, we'll be covering all these different parts with the examples so first of all,
let's start with the YAML document

Example YAML File


As it is marked by three dashes at the beginning of the file.

Document next we have ending is marked by three dots at the end of the document both the start and the ending is optional and you're only required to put them when a yml file may consist of multiple different yaml documents and you want to separate between all the documents in the file

We can also have comments in the file comments start with the pound sign and you can also have multiple line comments with multiple pound signs at the beginning of each line yaml files are just a bunch of key-value pairs you can have an underscore in the key name you can also have the spaces in their key name can also have a dot in there.

You can also have codes around the key names which is useful when you have a colon in the key name and also you can have the numeric keys as well the value for each key can be of a specific type there are two categories of types supported by yaml

WIP

Top #3 Articles