KJB_ROOTLESS_ARRAY -> kjbrootlessarray
This commit is contained in:
@@ -45,7 +45,7 @@ public class ApiRequestBodyFilter extends OncePerRequestFilter {
|
|||||||
// 3. 예제: ROOTLESS ARRAY 보정
|
// 3. 예제: ROOTLESS ARRAY 보정
|
||||||
if (json instanceof JSONArray) {
|
if (json instanceof JSONArray) {
|
||||||
JSONObject wrap = new JSONObject();
|
JSONObject wrap = new JSONObject();
|
||||||
wrap.put("KJB_ROOTLESS_ARRAY", json);
|
wrap.put("kjbrootlessarray", json);
|
||||||
modifiedBody = wrap.toJSONString();
|
modifiedBody = wrap.toJSONString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -37,8 +37,8 @@ public class ApiResponseAdvice implements ResponseBodyAdvice<Object> {
|
|||||||
try {
|
try {
|
||||||
Object root = JSONValue.parse(body);
|
Object root = JSONValue.parse(body);
|
||||||
|
|
||||||
if (root instanceof JSONObject && ((JSONObject) root).containsKey("KJB_ROOTLESS_ARRAY")) {
|
if (root instanceof JSONObject && ((JSONObject) root).containsKey("kjbrootlessarray")) {
|
||||||
JSONArray jsonArray = (JSONArray) ((JSONObject) root).get("KJB_ROOTLESS_ARRAY");
|
JSONArray jsonArray = (JSONArray) ((JSONObject) root).get("kjbrootlessarray");
|
||||||
return jsonArray.toJSONString();
|
return jsonArray.toJSONString();
|
||||||
} else {
|
} else {
|
||||||
return body;
|
return body;
|
||||||
|
|||||||
Reference in New Issue
Block a user