Change to use getTableWrapperObjectName in places it was intended (e.g., within JSON objects), instead of getTablePath(meant for URLs)

This commit is contained in:
2023-04-12 11:20:12 -05:00
parent d009169770
commit 8f6e4144d2

View File

@ -447,11 +447,11 @@ public class BaseAPIActionUtil
}
else
{
String tablePath = getBackendDetails(table).getTablePath();
String wrapperObjectName = getBackendDetails(table).getTableWrapperObjectName();
jsonObject = JsonUtils.toJSONObject(resultString);
if(jsonObject.has(tablePath))
if(jsonObject.has(wrapperObjectName))
{
Object o = jsonObject.get(tablePath);
Object o = jsonObject.get(wrapperObjectName);
if(o instanceof JSONArray jsonArray)
{
resultList = jsonArray;
@ -463,7 +463,7 @@ public class BaseAPIActionUtil
}
else
{
throw (new QException("Unrecognized object until tablePath: " + o));
throw (new QException("Unrecognized object until wrapperObjectName: " + o));
}
}
}
@ -731,11 +731,11 @@ public class BaseAPIActionUtil
JSONObject body = recordToJsonObject(table, record);
String json = body.toString();
String tablePath = getBackendDetails(table).getTablePath();
if(tablePath != null)
String wrapperObjectName = getBackendDetails(table).getTableWrapperObjectName();
if(wrapperObjectName != null)
{
body = new JSONObject();
body.put(tablePath, new JSONObject(json));
body.put(wrapperObjectName, new JSONObject(json));
json = body.toString();
}
return (new StringEntity(json));
@ -760,11 +760,11 @@ public class BaseAPIActionUtil
}
String json = entityListJson.toString();
String tablePath = getBackendDetails(table).getTablePath();
if(tablePath != null)
String wrapperObjectName = getBackendDetails(table).getTableWrapperObjectName();
if(wrapperObjectName != null)
{
JSONObject body = new JSONObject();
body.put(tablePath, new JSONArray(json));
body.put(wrapperObjectName, new JSONArray(json));
json = body.toString();
}
return (new StringEntity(json));
@ -848,7 +848,7 @@ public class BaseAPIActionUtil
/*******************************************************************************
**
*******************************************************************************/
protected QHttpResponse makeRequest(QTableMetaData table, HttpRequestBase request) throws QException
public QHttpResponse makeRequest(QTableMetaData table, HttpRequestBase request) throws QException
{
int sleepMillis = getInitialRateLimitBackoffMillis();
int rateLimitsCaught = 0;