I need to parse Json response
{
"product": "office",
"info":
{
"brand":
[
"1brand"
],
"detail":
{
"number":
{
"min": 1,
"max": 5
},
}
}
};
to object with dotted strings keys
{
"product" : "office",
"info.brand" : ["1brand"],
"info.detail.number.min" : 1,
"info.detail.number.max" : 5
}
Number of nested and adjacent objects isn't known. Solution should be function with one parameter - response object and return with new object (with dotted strings keys).