Ray's Knowledge Base

An unquoted null in a YAML list is a null, not the string "null"

PitfallVerified 27 Sep 2026Holds anywhere
Pitfall. The symptom, what causes it, and the fix that was run and seen to work.

Symptom#

A YAML front matter with a tag list such as tags: [query, null, regex] (or - null on its own line) fails to load where strings are expected. rkb refused it with:

frontmatter: invalid type: unit value, expected a string

Cause#

YAML reads a bare null (also ~ and an empty value) as the null value, not text. Other bare words change type too, such as true, false, and numbers.

Fix#

Quote the word: - "null", - "true", - "1.0".

Evidence#

  • 2026-09-27: rkb add with the tag - null failed as above; - "null" was accepted (lesson 54489520b7).