Question

How do I write in YAML a dictionary (map) where one key has the empty string as its value?

Was it helpful?

Solution

key:

is parsed as null -

%YAML 1.1
---
!!map {
    ? !!str "key"
    : !!null "null",
}

The correct answer is:

key: ""
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top