rest - unable to convert yaml string to map with key "NO" in java -


while trying convert yaml string map getting key change.
yaml file:-

--- hk:    isp:      airtel: airtelchennal   www.enemalta.com:      default: defaultema     user1: chennal1   studiodefault: hkdefaultchennal   country:      dk: denmarkchennal     no: chennal2 

java code:-

yaml yaml= new yaml(); map<string,object> map= (map<string, object>) yaml.load(yamlstring); 

output :-

{hk={isp={airtel=airtelchennal}, www.enemalta.com={default=defaultema, user1=chennal1}, studiodefault=hkdefaultchennal, country={dk=denmarkchennal, false=chennal2}}} 

in above output false replace "no", need "no" is.

expected output:-

{hk={isp={airtel=airtelchennal}, www.enemalta.com={default=defaultema, user1=chennal1}, studiodefault=hkdefaultchennal, country={dk=denmarkchennal, no=chennal2}}} 

according article: http://makandracards.com/makandra/24809-yaml-keys-like-yes-or-no-evaluate-to-true-and-false

in order use strings ‘yes’ , ‘no’ keys, need wrap them quotes


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -