views:

281

answers:

1

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

+5  A: 

key:

is parsed as null -

%YAML 1.1

!!map { ? !!str "key" : !!null "null", }

The correct answer is:

key: ""