[Solved]: Dictionary with empty value in YAML



Problem statement:

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


Solution:

You can use one of these 3 Approaches:

YAML

# 1st Approach is Recommended  key: null key: ~ key:

JSON OUTPUT for all three:

{  "key": null}

Reference: I have answered in stackoverflow also, you can check here            https://stackoverflow.com/a/49679846/9339242