diff --git a/api-test/backend/src/main/java/io/metersphere/api/parse/ApiImportAbstractParser.java b/api-test/backend/src/main/java/io/metersphere/api/parse/ApiImportAbstractParser.java index 8d743f9d42..d5435de0af 100644 --- a/api-test/backend/src/main/java/io/metersphere/api/parse/ApiImportAbstractParser.java +++ b/api-test/backend/src/main/java/io/metersphere/api/parse/ApiImportAbstractParser.java @@ -165,7 +165,7 @@ public abstract class ApiImportAbstractParser implements ApiImportParser { protected MsHTTPSamplerProxy buildRequest(String name, String path, String method, String jsonSchema) { MsHTTPSamplerProxy request = buildRequest(name, path, method); if (StringUtils.isNotBlank(jsonSchema)) { - request.getBody().setJsonSchema(JSONUtil.parseObject(jsonSchema)); + request.getBody().setJsonSchema(JSON.parseObject(jsonSchema)); request.getBody().setFormat("JSON-SCHEMA"); } return request; diff --git a/api-test/backend/src/main/java/io/metersphere/service/definition/ApiDefinitionService.java b/api-test/backend/src/main/java/io/metersphere/service/definition/ApiDefinitionService.java index 7540505282..4740f6a690 100644 --- a/api-test/backend/src/main/java/io/metersphere/service/definition/ApiDefinitionService.java +++ b/api-test/backend/src/main/java/io/metersphere/service/definition/ApiDefinitionService.java @@ -1282,14 +1282,14 @@ public class ApiDefinitionService { // put the data into the to-be-synchronized if (!StringUtils.equals(exApiString, apiString)) { if (!StringUtils.equals(apiDefinition.getMethod(), existApi.getMethod())) { - if (apiSyncCaseRequest.getMethod() && toUpdate) { + if (BooleanUtils.toBoolean(apiSyncCaseRequest.getMethod()) && toUpdate) { apiDefinition.setToBeUpdated(true); apiDefinition.setToBeUpdateTime(System.currentTimeMillis()); } return true; } if (!StringUtils.equals(apiDefinition.getProtocol(), existApi.getProtocol())) { - if (apiSyncCaseRequest.getProtocol() && toUpdate) { + if (BooleanUtils.toBoolean(apiSyncCaseRequest.getProtocol()) && toUpdate) { apiDefinition.setToBeUpdated(true); apiDefinition.setToBeUpdateTime(System.currentTimeMillis()); } @@ -1297,7 +1297,7 @@ public class ApiDefinitionService { } if (!StringUtils.equals(apiDefinition.getPath(), existApi.getPath())) { - if (apiSyncCaseRequest.getPath() && toUpdate) { + if (BooleanUtils.toBoolean(apiSyncCaseRequest.getPath()) && toUpdate) { apiDefinition.setToBeUpdated(true); apiDefinition.setToBeUpdateTime(System.currentTimeMillis()); } @@ -1320,7 +1320,7 @@ public class ApiDefinitionService { if (exApiRequest.get("headers") != null && apiRequest.get("headers") != null) { if (!StringUtils.equals(exApiRequest.get("headers").toString(), apiRequest.get("headers").toString())) { - if (apiSyncCaseRequest.getHeaders() && toUpdate) { + if (BooleanUtils.toBoolean(apiSyncCaseRequest.getHeaders()) && toUpdate) { apiDefinition.setToBeUpdated(true); apiDefinition.setToBeUpdateTime(System.currentTimeMillis()); } @@ -1330,7 +1330,7 @@ public class ApiDefinitionService { if (exApiRequest.get("arguments") != null && apiRequest.get("arguments") != null) { if (!StringUtils.equals(exApiRequest.get("arguments").toString(), apiRequest.get("arguments").toString())) { - if (apiSyncCaseRequest.getQuery() && toUpdate) { + if (BooleanUtils.toBoolean(apiSyncCaseRequest.getQuery()) && toUpdate) { apiDefinition.setToBeUpdated(true); apiDefinition.setToBeUpdateTime(System.currentTimeMillis()); } @@ -1340,7 +1340,7 @@ public class ApiDefinitionService { if (exApiRequest.get("rest") != null && apiRequest.get("rest") != null) { if (!StringUtils.equals(exApiRequest.get("rest").toString(), apiRequest.get("rest").toString())) { - if (apiSyncCaseRequest.getRest() && toUpdate) { + if (BooleanUtils.toBoolean(apiSyncCaseRequest.getRest()) && toUpdate) { apiDefinition.setToBeUpdated(true); apiDefinition.setToBeUpdateTime(System.currentTimeMillis()); }