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
Post a Comment