Glossary termData serialization language

YAML

Also known as: YAML Ain't Markup Language, Yet Another Markup Language

Human-readable data serialization language that uses indentation to express structure, widely used for configuration files and data exchange.

YAML is a text format for representing structured data in a way that is comfortable for people to read and write. Instead of braces and brackets, it uses indentation to show nesting, a colon to separate keys from values and a leading hyphen to mark list items. It supports comments, multi-line strings, references that let one part of a document reuse another and multiple documents in a single file. Its name is a recursive acronym, YAML Ain't Markup Language, which replaced the earlier expansion Yet Another Markup Language to emphasize that it is about data rather than document markup.

Clark Evans first proposed YAML in 2001 and designed it with Ingy dot Net and Oren Ben-Kiki. Version 1.2, released in 2009, aligned the language so that valid JSON documents are, with minor exceptions, also valid YAML. The format became a standard for configuration in DevOps tooling: Kubernetes manifests, Ansible playbooks, Docker Compose files and continuous integration workflows on platforms such as GitHub Actions and GitLab CI are typically written in YAML, which makes it central to infrastructure as code.

YAML's flexibility brings pitfalls. Whitespace is significant, so a misplaced space can silently change meaning. Under the older YAML 1.1 rules, still followed by some parsers, unquoted values such as no, yes and off are read as booleans, so a list of country codes can turn Norway's NO into false, a well-known trap nicknamed the Norway problem. Loading untrusted YAML with full-featured parsers has also allowed attackers to construct arbitrary objects and run code, which is why libraries offer safe loading modes. Many projects lint YAML files and validate them against schemas.

Key points

  • YAML uses indentation, colons and hyphens to express nested data in a human-friendly way.
  • Version 1.2, released in 2009, made YAML largely a superset of JSON.
  • YAML is the dominant configuration format for Kubernetes, Ansible and many CI/CD systems.
  • Significant whitespace, implicit typing and unsafe loaders are well-known sources of YAML bugs and vulnerabilities.

Related entries

Glossary term

JSON

Programming

Lightweight, text-based data interchange format that represents structured data as nested objects and arrays, derived from JavaScript syntax.

Technology

Kubernetes

DevOpsFOSS

Open-source system for automating deployment, scaling and management of containerized applications across clusters of machines.

Technology

Ansible

DevOpsFOSS

Open-source, agentless automation tool that configures servers, deploys software and orchestrates IT tasks using YAML playbooks run over SSH.

Glossary term

Practice of defining and provisioning servers, networks and other infrastructure through machine-readable files rather than manual configuration.

Glossary term

DevOps

DevOpsIdeas and Culture

Set of cultural practices and tools that unites software development and IT operations to deliver changes faster and more reliably.

Glossary term

Discipline and tooling for establishing and maintaining a known, consistent state for systems, software and their settings over time.

Glossary term

Automated sequence of stages that builds, tests and releases software changes, combining continuous integration with continuous delivery or deployment.

Glossary term

Linting

Programming

Automated checking of source code for likely errors, suspicious constructs and style violations using a tool called a linter.

Referenced by

Other entries that discuss or point to YAML.