I got the problem when parsing JSON to Map[String, String]. The idea is to parse the nested object to a key separate by "."
Can we format this input JSON:
{
"key-1":{
"sub-key-1-1":{
"sub-key-1-1-1":"value111"
},
"sub-key-1-2":{
"sub-key-1-2-1":"value121"
}
},
"key-2":{
"sub-key-2-1":{
"sub-key-2-1-1":"value211"
}
}
}
to this result as Map[String,String]:
("key-1.sub-key-1-1.sub-key-1-1-1"->"value111",
"key-1.sub-key-1-2.sub-key-1-2-1"->"value121",
"key-2.sub-key-2-1.sub-key-2-1-1"->"value211")