Hello.
I am working with a SOAP API (I know, not my choice either), which returns JSON inside an XML element. I can extract the JSON just fine, but the JSON itself has an interesting syntax.
Inside the JSON is an element called "TblProjects". If there are more than 1 project, it gives them in an array. So far so good, but when only a single project is returned, it gives it as an object. For example:
"tblProjects": {
"PrID": "49835",
"PrCode": "486732-14"
}
and
"tblProjects": {
[
"PrID": "49835",
"PrCode": "486732-14"
],
[
"PrID": "49836",
"PrCode": "486741-10"
]
}
I am able to extract these without problem, but I need to detect if it's a single object or an array of objects.
So my question is: How do I detect this?
Best regards,
Pijke