Hi, I wrote the json reader to read the data & works fine with the below data.
{"menu": {
"id": "file",
"value": "File",
"popup": {
"menuitem": [
{"value": "New", "onclick": "CreateNewDoc()"},
{"value": "Open", "onclick": "OpenDoc()"},
{"value": "Close", "onclick": "CloseDoc()"}
]
}
}}
but the when json returns the single menuitem from api like
{"menu": {
"id": "file",
"value": "File",
"popup": {
"menuitem":
{"value": "Close", "onclick": "CloseDoc()"}
}
}}
menuitem is an object instead of an array. So, my json reader is failing to read as i'm readin the array of menuitem by looping.
solution is greatly appreciated. How this is handled by other major sites?