DEV Community

Cover image for Cheatsheet for YAML
Annoh Karlgusta
Annoh Karlgusta

Posted on

Cheatsheet for YAML

YAML is a data serialization language commonly used to create configuration files. YAML stands for yet another markup language or YAML ain't markup language (a recursive acronym) depending on who you ask, emphasizing that YAML is for data rather than documents.

Syntax for YAML
Perl, C, XML, HTML, and other programming languages are all represented in YAML. JSON files are valid in YAML because it is a superset of JSON.

Nesting is shown in YAML using Python-style indentation. Because tab characters are not permitted, whitespace is used instead. Braces, square brackets, closing tags, and quotation marks are not included in the standard format. The extension of YAML files is .yml or.yaml.

The creation of configuration files is one of the most prevalent uses for YAML. Even though they can be used interchangeably in most circumstances, it is advised that configuration files be written in YAML rather than JSON because YAML is easier to read and understand. YAML is utilized for Kubernetes resources and deployments in addition to Ansible. One advantage of utilizing YAML is that it can be incorporated to source control systems like GitHub, allowing changes to be recorded and audited.

See you soon.

Discussion (0)