KJB_ROOTLESS_ARRAY -> DJB_ROOTLESS_ARRAY

This commit is contained in:
curry772
2026-03-18 09:33:21 +09:00
parent 10f4040c0c
commit 1160c9f941
@@ -14,7 +14,7 @@ import org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice;
@RestControllerAdvice
public class ApiResponseAdvice implements ResponseBodyAdvice<Object> {
static final String KJB_ROOTLESS_ARRAY = "{ \"KJB_ROOTLESS_ARRAY\" : ";
private static final String DJB_ROOTLESS_ARRAY = "DJB_ROOTLESS_ARRAY";
@Override
public boolean supports(MethodParameter returnType, Class<? extends HttpMessageConverter<?>> converterType) {
@@ -40,8 +40,8 @@ public class ApiResponseAdvice implements ResponseBodyAdvice<Object> {
try {
Object root = JSONValue.parse(body);
if (root instanceof JSONObject && ((JSONObject) root).containsKey("KJB_ROOTLESS_ARRAY")) {
JSONArray jsonArray = (JSONArray) ((JSONObject) root).get("KJB_ROOTLESS_ARRAY");
if (root instanceof JSONObject && ((JSONObject) root).containsKey(DJB_ROOTLESS_ARRAY)) {
JSONArray jsonArray = (JSONArray) ((JSONObject) root).get(DJB_ROOTLESS_ARRAY);
return jsonArray.toJSONString();
} else {
return body;