| | |

YAML 01 ๐Ÿ“„ Introduction to YAML โ€” Where It Came From and Where It’s Used

โฑ๏ธ Estimated read: 8 min | |

YAML is a human-readable data serialization language. That definition is precise: it is not a programming language, not a markup language, and not a document format. It exists to represent structured dataโ€”maps, lists, scalarsโ€”in a form that a person can read and edit without special tooling, and that a machine can parse deterministically. The name is a recursive acronym: “YAML Ain’t Markup Language,” a deliberate retronym that replaced the original “Yet Another Markup Language” once the creators decided the emphasis should be on data, not documents .

This chapter covers the origins of YAML, the problems its creators were reacting to, and the tools that made it ubiquitous. It explains why a format designed for data serialization became the configuration language of Kubernetes, Docker Compose, Ansible, and CI/CD pipelines, and why its syntax choicesโ€”indentation, minimal punctuation, anchorsโ€”matter for both readability and failure modes.

Key point: YAML is a data serialization language that prioritizes human readability; its adoption by infrastructure tools is a consequence of that readability, not a design goal.


Why YAML exists

The XML verbosity problem. YAML emerged in 2001 from two converging efforts. Clark Evans and Oren Ben-Kiki were working on simplifying XML within the sml-dev group; Ingy dรถt Net had built a Perl module called Data::Denter for serializing data structures. Their visions were similar, and within days of the first public YAML draft on 12 May 2001, they collaborated and YAML was born . The shared motivation was XML’s verbosity: angle brackets, closing tags, and attribute syntax made structured data tedious to read and write by hand. YAML’s answer was to remove almost all punctuation and use indentation to express nesting, borrowing the idea from Python .

The “markup versus data” distinction. The original name, “Yet Another Markup Language,” placed YAML in the lineage of HTML and XML. The creators renamed it to “YAML Ain’t Markup Language” to signal that YAML does not mark up documents; it serializes data . This distinction matters because it explains the syntax: no tags, no attributes, no document structure beyond what the data itself requires. A YAML file describes a map or a list, and the indentation shows which keys belong to which values.

The readability trade-off. YAML’s readability comes at a cost. Indentation is significant, so a misplaced space changes the meaning of a file. Implicit typingโ€”unquoted true becoming a boolean, unquoted 2026-05-05 becoming a date in older parsersโ€”has caused well-documented bugs like the “Norway problem,” where the country code NO parsed as false in YAML 1.1 implementations . YAML 1.2 addressed these issues by restricting implicit typing and removing sexagesimal numbers, but many parsers, particularly Python’s PyYAML, still implement YAML 1.1 semantics .


a. The YAML specification lineage

YAML has three specification versions. YAML 1.0 was published in 2004; 1.1 in 2005; and 1.2 in 2009. A clarifying revision, 1.2.2, was completed in October 2021 . The 1.2 specification made JSON a strict subset of YAML, meaning every valid JSON document is also valid YAML, and tightened implicit typing rules to eliminate the most common parsing surprises .

The specification gap matters in practice because the parser you use determines the YAML you get. A file that behaves one way in a Rust-based YAML 1.2 parser may behave differently in PyYAML, which implements 1.1 and has not changed its core semantics since 2006 . When a YAML file “doesn’t work,” the first question is often which specification version the parser implements.


b. Where YAML is used

YAML’s adoption is concentrated in infrastructure and configuration. Kubernetes manifests define every resourceโ€”deployments, services, config mapsโ€”as a YAML document with a fixed apiVersion, kind, metadata, and spec structure . Docker Compose uses compose.yml to define services, networks, volumes, and port mappings . Ansible playbooks declare desired server state, variables, and roles in YAML . GitHub Actions and GitLab CI define pipelines as YAML workflows .

The common thread is that these tools need configuration that humans write and machines read. JSON would workโ€”every one of these tools has a JSON equivalentโ€”but the verbosity of braces and quotes makes large configuration files harder to scan and edit. YAML’s indentation-based structure maps visually onto the hierarchy of the configuration itself, which is why the tools adopted it .

Outside infrastructure, YAML appears in static site generators for front matter (titles, dates, tags, authors), in OpenAPI specifications for API definitions, and in content management systems for metadata . The pattern is consistent: wherever structured data needs to be written by hand and read by both people and programs, YAML is a candidate.


Complete Example Session

# ============================================
# PART 1: A SCALAR MAP (KEY-VALUE PAIRS)
# ============================================
name: my-application
version: 1.2.0
replicas: 3

# ============================================
# PART 2: A LIST
# ============================================
environments:
  - development
  - staging
  - production

# ============================================
# PART 3: NESTED STRUCTURE
# ============================================
database:
  host: db.example.com
  port: 5432
  credentials:
    username: app_user
    # password comes from an environment variable
    password: ${DB_PASSWORD}

# ============================================
# PART 4: ANCHORS AND ALIASES (REUSE)
# ============================================
defaults: &default_settings
  timeout: 30
  retries: 3

service_a:
  <<: *default_settings
  endpoint: /a

service_b:
  <<: *default_settings
  endpoint: /b

# ============================================
# PART 5: THE PARSED RESULT (MENTAL MODEL)
# ============================================
# {
#   name: "my-application",
#   version: "1.2.0",
#   replicas: 3,
#   environments: ["development", "staging", "production"],
#   database: { host: "db.example.com", port: 5432, credentials: { ... } },
#   service_a: { timeout: 30, retries: 3, endpoint: "/a" },
#   service_b: { timeout: 30, retries: 3, endpoint: "/b" }
# }

The parts covered scalars and maps, lists, nested structure, anchors and merge keys for reuse, and the parsed data model that the YAML represents.


Quick Reference

YAML Timeline

YearEvent
1999First “YML” mention by Clark Evans
2001YAML first publicized (12 May); name coined
2004YAML 1.0 specification
2005YAML 1.1 specification
2009YAML 1.2 specification
2021YAML 1.2.2 clarifying revision

Common YAML Tools

ToolFilePurpose
Kubernetesdeployment.yamlContainer orchestration
Docker Composecompose.ymlMulti-container apps
Ansibleplaybook.ymlConfiguration management
GitHub Actions.github/workflows/*.ymlCI/CD pipelines
OpenAPIopenapi.yamlAPI specifications

Core Data Types

TypeYAML Example
Stringname: my-app
Numberreplicas: 3
Booleanenabled: true
List- item1 (under a key)
Mapkey: followed by indented pairs

Best Practices

โœ… Do This:

# Quote strings that look like booleans or numbers
country_code: "NO"                                           # โœ… (not false)
version: "1.2"                                               # โœ… (not number)

# Use spaces, never tabs, for indentation
key:
  nested: value                                              # โœ…

# Use anchors for repeated blocks
defaults: &defaults
  timeout: 30
service: { <<: *defaults }                                   # โœ…

โŒ Don’t Do This:

# Unquoted ambiguous values
country_code: NO                                             # โŒ (YAML 1.1: boolean false)

# Tabs for indentation
key:
	nested: value                                            # โŒ (parse error)

# Duplicate keys
name: app1
name: app2                                                   # โŒ (last wins, silent)

Common Pitfalls

PitfallWhy It HappensFix
NO parsed as falseYAML 1.1 implicit booleanQuote as "NO"
Tab indentation errorTabs forbidden for indentationUse spaces only
Date parsed as string (1.2)Timestamp removed from core schemaParse explicitly if needed
Duplicate key silently overwrittenNo duplicate-key warningLint the YAML

Real-World Examples

1. Kubernetes deployment

apiVersion: apps/v1
kind: Deployment
metadata:
  name: web
spec:
  replicas: 3

2. Docker Compose service

services:
  web:
    image: nginx:latest
    ports:
      - "80:80"

3. Ansible task

- name: Install nginx
  apt:
    name: nginx
    state: present

4. GitHub Actions workflow

on: push
jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

5. Front matter for a static site

---
title: My Post
date: 2026-05-05
tags: [yaml, config]
---

6. Anchor for repeated config

logging: &log
  level: info
  format: json
api: { <<: *log }
worker: { <<: *log }

7. Quoting the Norway problem

country: "NO"

8. List of maps

users:
  - name: Ana
    role: admin
  - name: Ben
    role: viewer

9. Environment variable interpolation

password: ${DB_PASSWORD}

10. Multi-document file

---
kind: ConfigMap
---
kind: Secret

Visual

YAML Origins

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  YAML ORIGINS (2001)                                    โ”‚
โ”‚                                                         โ”‚
โ”‚  Clark Evans + Oren Ben-Kiki                            โ”‚
โ”‚  (simplifying XML in sml-dev)                           โ”‚
โ”‚         โ”‚                                               โ”‚
โ”‚         โ”‚    Ingy dรถt Net                               โ”‚
โ”‚         โ”‚    (Data::Denter for Perl)                    โ”‚
โ”‚         โ”‚         โ”‚                                     โ”‚
โ”‚         โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”˜                                     โ”‚
โ”‚              โ–ผ                                          โ”‚
โ”‚  YAML first publicized 12 May 2001                      โ”‚
โ”‚  Name: "Yet Another Markup Language"                    โ”‚
โ”‚              โ”‚                                          โ”‚
โ”‚              โ–ผ                                          โ”‚
โ”‚  Renamed: "YAML Ain't Markup Language"                  โ”‚
โ”‚  (emphasis on data, not documents)                      โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Where YAML Sits

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  CONFIGURATION FORMAT LANDSCAPE                         โ”‚
โ”‚                                                         โ”‚
โ”‚  Human-readable โ—„โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–บ Machine-first  โ”‚
โ”‚                                                         โ”‚
โ”‚  YAML          TOML          JSON          XML          โ”‚
โ”‚    โ”‚             โ”‚             โ”‚             โ”‚          โ”‚
โ”‚    โ–ผ             โ–ผ             โ–ผ             โ–ผ          โ”‚
โ”‚  Indentation   Sections      Braces       Tags          โ”‚
โ”‚  significant   + keys        + quotes     + nesting     โ”‚
โ”‚                                                         โ”‚
โ”‚  YAML: most readable, most implicit                     โ”‚
โ”‚  JSON: most explicit, least readable                    โ”‚
โ”‚  Both: Kubernetes, Docker, CI                           โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

The Configuration Tool Stack

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  TOOLS THAT USE YAML                                    โ”‚
โ”‚                                                         โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”‚
โ”‚  โ”‚ Kubernetes   โ”‚  โ”‚ Docker       โ”‚  โ”‚ Ansible      โ”‚   โ”‚
โ”‚  โ”‚ manifests    โ”‚  โ”‚ Compose      โ”‚  โ”‚ playbooks    โ”‚   โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ”‚
โ”‚         โ”‚                 โ”‚                 โ”‚           โ”‚
โ”‚         โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜           โ”‚
โ”‚                           โ–ผ                             โ”‚
โ”‚                    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                     โ”‚
โ”‚                    โ”‚   YAML       โ”‚                     โ”‚
โ”‚                    โ”‚   (shared    โ”‚                     โ”‚
โ”‚                    โ”‚   format)    โ”‚                     โ”‚
โ”‚                    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                     โ”‚
โ”‚                           โ”‚                             โ”‚
โ”‚         โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”           โ”‚
โ”‚         โ–ผ                 โ–ผ                 โ–ผ           โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”‚
โ”‚  โ”‚ GitHub       โ”‚  โ”‚ GitLab CI    โ”‚  โ”‚ OpenAPI      โ”‚   โ”‚
โ”‚  โ”‚ Actions      โ”‚  โ”‚ pipelines    โ”‚  โ”‚ specs        โ”‚   โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Summary

ItemValue
Full nameYAML Ain’t Markup Language (recursive)
Original nameYet Another Markup Language
First publicized12 May 2001
CreatorsClark Evans, Ingy dรถt Net, Oren Ben-Kiki
TypeData serialization language
Specification versions1.0 (2004), 1.1 (2005), 1.2 (2009)
Key design choiceIndentation-based nesting
Primary useConfiguration files, infrastructure as code
Defining toolsKubernetes, Docker Compose, Ansible, CI/CD

Key takeaways:

  • YAML is a data serialization language, not a markup language. The name change from “Yet Another Markup Language” to “YAML Ain’t Markup Language” reflects the shift in emphasis from documents to data .
  • It emerged from XML frustration and Perl serialization needs. Clark Evans and Oren Ben-Kiki wanted a simpler alternative to XML; Ingy dรถt Net had built Data::Denter. The three collaborated within days of the first draft .
  • Indentation is the syntax. Nesting is expressed by spaces, not braces. This is what makes YAML readable and what makes a misplaced space a parse error.
  • The specification and the parser are different things. YAML 1.2 fixed the implicit-typing problems of 1.1, but PyYAML still implements 1.1, which is why the “Norway problem” persists in Python ecosystems .
  • Infrastructure tools adopted YAML for readability. Kubernetes, Docker Compose, Ansible, and CI/CD pipelines all use YAML because humans write the configuration and machines read it. JSON would work; YAML is easier to scan and edit .

Remember: YAML exists because structured data needs to be readable by the people who write it, not just the programs that consume it. That design goal produced indentation-based syntax, minimal punctuation, and a set of implicit typing rules that have caused real bugs. Understanding YAML means understanding both the readability it offers and the precision it requires: quote ambiguous values, use spaces for indentation, and know which specification version your parser implements. The format is small; the failures come from the edges.

Was this helpful?


Stop using slow, ad-bloated tool sites! ๐Ÿคฎ

๐Ÿ”Ž Search “KandZ Tools” on Google to use many professional utilities for free.

KandZ.me is the ultimate minimalist hub for:
โœ… Finance (Mortgage, Interest, Inflation)
โœ… Tech (Base64, JSON, Dev Suite, IP)
โœ… Health (BMI, BMR, TDEE)
โœ… Productivity (Timer, Workspace, QR)

โšก๏ธ Fast & Private
๐Ÿ”’ No data leaves your device
๐Ÿ’Ž 100% Free

๐Ÿ”— Use it now: https://tools.kandz.me
๐Ÿ”– Bookmark itโ€”youโ€™ll need it later!