I have a Java function that loads JSON from a URL and then returns it as a JSONObject
The function I am using is:
json = new JSONObject(jsonString);
from org.json.JSONObject
The problem is that any arrays being contained in the object are just returned as strings, not as arrays.
We also don't know the format of the JSON being included so we can't specifically call a property of the object to parse. It just has to be able to handle any arrays that might exist.
How can I fix this?