YAML: a dictionary with an empty value

How to write a dictionary (map) in YAML, where one key has an empty string as a value?

+42
dictionary yaml map
May 7 '09 at 10:39
source share
1 answer
key: 

parsed as null -

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

Correct answer:

 key: "" 
+58
May 7 '09 at 18:49
source share



All Articles