mirror of
https://github.com/Kingsrook/qqq.git
synced 2025-07-18 05:01:07 +00:00
update to not just assume object is a JSONArray, but to check it to try to avoid some type errors
This commit is contained in:
@ -450,7 +450,20 @@ public class BaseAPIActionUtil
|
|||||||
jsonObject = JsonUtils.toJSONObject(resultString);
|
jsonObject = JsonUtils.toJSONObject(resultString);
|
||||||
if(jsonObject.has(tablePath))
|
if(jsonObject.has(tablePath))
|
||||||
{
|
{
|
||||||
resultList = jsonObject.getJSONArray(getBackendDetails(table).getTablePath());
|
Object o = jsonObject.get(tablePath);
|
||||||
|
if(o instanceof JSONArray jsonArray)
|
||||||
|
{
|
||||||
|
resultList = jsonArray;
|
||||||
|
}
|
||||||
|
else if(o instanceof JSONObject recordJsonObject)
|
||||||
|
{
|
||||||
|
resultList = new JSONArray();
|
||||||
|
resultList.put(recordJsonObject);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw (new QException("Unrecognized object until tablePath: " + o));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user