MeridianMERIDIAN

YAML Document

container.object.yaml

YAML (YAML Ain't Markup Language) document stored as VARCHAR. Human-readable data serialization format with nested indentation.

Casts to
VARCHAR

Shape

Pattern
^[a-zA-Z_][a-zA-Z0-9_]*:\s*.*
ValueLengthShape
name: John age: 30 active: true31rejected
user: id: 123 email: john@example.com41rejected
name: John age: 30 active: tru30rejected: one character short

Told apart

1 of the 6 other object types accept every one of these samples on shape alone.

Background

Origin

YAML was first proposed by Clark Evans in 2001.[1] Clark Evans designed YAML together with Ingy döt Net and Oren Ben-Kiki.[1] The name YAML originally stood for Yet Another Markup Language.[1] Between December 2001 and April 2002 the name was repurposed as the recursive acronym YAML Ain't Markup Language, to mark the format as data-oriented rather than document markup.[1] The YAML project was initially rooted in Clark Evans and Oren Ben-Kiki's work on the SML-DEV mailing list, which was about simplifying XML, and in Ingy döt Net's plain text serialisation module for Perl.[2] The first YAML framework was written in Perl in 2001.[2] Ruby was the first language to ship a YAML framework as part of its core language distribution, in 2003.[2]

The YAML 1.0 specification was published in early 2004, after 3 years of collaborative design work through the yaml-core mailing list.[2] The YAML 1.1 specification was published in 2005.[2] The YAML 1.2 specification was published in 2009, and its primary focus was making YAML a strict superset of JSON.[2] YAML 1.2 also removed many of the problematic implicit typing recommendations.[2] Revision 1.2.2 of the specification is dated 2021-10-01 and makes no normative changes from YAML 1.2.[2] The YAML specification describes YAML as a human-friendly, cross language, Unicode based data serialisation language designed around the common native data types of dynamic programming languages.[2] The YAML specification says the language was specifically created to work well for configuration files, log files, interprocess messaging, cross-language data sharing, object persistence and debugging of complex data structures.[2] YAML's colon-centred key-value syntax is inspired by the electronic mail headers of RFC 822, and its document separator --- is borrowed from MIME.[1]

RFC 9512, published by the IETF in February 2024, registers the application/yaml media type.[3] RFC 9512 gives yaml as the preferred file extension and yml as an alternative.[3] RFC 9512 lists application/x-yaml, text/yaml and text/x-yaml as deprecated alias names that are used but not registered.[3]

Use

In YAML block styles, structure is determined by indentation.[2] The YAML specification forbids tab characters in indentation, to maintain portability.[2] Three dots mark the end of a YAML document without starting a new one.[2] In the YAML representation model, mapping keys do not have an order, and the order they are written in is a serialisation detail that should not be used to carry application data.[2] Do not rely on the order of keys in a YAML mapping surviving a round trip; if order matters, expect a sequence. (Meridian's view)

YAML's type autodetection is a known source of errors: unquoted Yes and No can become booleans, and software version numbers can be converted to floats.[1] A version number, postcode or identifier that matters as text should be quoted in YAML you write, and checked as text in YAML you read. (Meridian's view)

RFC 9512 warns that the resolution of YAML tags might trigger unexpected code execution, and says code execution in deserialisers should be disabled by default.[3] The PyYAML documentation warns that it is not safe to call yaml.load with any data received from an untrusted source.[4] PyYAML's safe_load recognises only standard YAML tags and cannot construct an arbitrary Python object.[4] Parse YAML that arrives in data with a safe loader, never one that builds arbitrary objects from tags, however trusted the file seems. (Meridian's view)

Where you'll meet it

GitHub Actions workflow files use YAML syntax and must have either a .yml or .yaml file extension.[5] The Kubernetes documentation says that, by convention, Kubernetes manifests are YAML, though JSON can also be used.[6] Ansible playbooks, Ansible's configuration management language, are expressed in YAML.[7]

Detection notes

v1 migration: New for v2. YAML is common in configuration files but less common in analytics data. DuckDB does not have native YAML support; parsing requires external crates and is slower than JSON.

Use it

CLI · DuckDB
$ finetype infer -i "name: John
age: 30
active: true" --mode column
→ container.object.yaml

SELECT ft_infer('name: John
age: 30
active: true');
-- → 'container.object.yaml'
Cast expression
CAST({col} AS VARCHAR)

Schema

https://meridian.online/schemas/container.object.yaml · Frictionless type string

finetype taxonomy container.object.yaml -o json-schema

Aliases

yaml

Type Registry