diff --git a/api-test/backend/src/main/java/io/metersphere/api/exec/generator/JSONSchemaBuilder.java b/api-test/backend/src/main/java/io/metersphere/api/exec/generator/JSONSchemaBuilder.java index fc0b7c657d..04f116a5dd 100644 --- a/api-test/backend/src/main/java/io/metersphere/api/exec/generator/JSONSchemaBuilder.java +++ b/api-test/backend/src/main/java/io/metersphere/api/exec/generator/JSONSchemaBuilder.java @@ -50,8 +50,11 @@ public class JSONSchemaBuilder { } else if (object.has(PropertyConstant.TYPE)) { if (object.get(PropertyConstant.TYPE).getAsString().equals(PropertyConstant.ARRAY)) { analyzeProperty(rootObj, PropertyConstant.MS_OBJECT, object, map); - } else if (!object.get(PropertyConstant.TYPE).getAsString().equals(PropertyConstant.OBJECT)) { + } else if (!object.get(PropertyConstant.TYPE).getAsString().equals(PropertyConstant.OBJECT) && !(object instanceof JsonObject)) { + String asString = object.getAsString(); analyzeProperty(rootObj, object.getAsString(), object, map); + } else { + formatObject(map, object, rootObj); } } } @@ -256,7 +259,7 @@ public class JSONSchemaBuilder { } private static void formatObject(Map map, JsonObject jsonObject, JSONObject concept) { - JsonObject propertiesObj = jsonObject.get(PropertyConstant.PROPERTIES).getAsJsonObject(); + JsonObject propertiesObj = jsonObject.has(PropertyConstant.PROPERTIES) ? jsonObject.get(PropertyConstant.PROPERTIES).getAsJsonObject(): new JsonObject(); for (Entry entry : propertiesObj.entrySet()) { String propertyKey = entry.getKey(); JsonObject propertyObj = propertiesObj.get(propertyKey).getAsJsonObject(); diff --git a/api-test/frontend/src/business/automation/scenario/EditApiScenario.vue b/api-test/frontend/src/business/automation/scenario/EditApiScenario.vue index 7604cce8d1..6b69225efc 100644 --- a/api-test/frontend/src/business/automation/scenario/EditApiScenario.vue +++ b/api-test/frontend/src/business/automation/scenario/EditApiScenario.vue @@ -251,7 +251,7 @@ -
+
@@ -1512,12 +1512,14 @@ export default { this.showAll(); this.buttonData = buttons(this); this.initPlugins(); - this.selectedTreeNode = undefined; - this.selectedNode = undefined; + if (e && e.target.className && e.target.className.split(" ")[1] === "white--space") { + this.selectedTreeNode = undefined; + this.selectedNode = undefined; + } }, fabClick() { if (this.operatingElements && this.operatingElements.length < 1) { - if ((this.selectedTreeNode && this.selectedTreeNode.referenced === 'REF') || (this.selectedTreeNode.disabled && this.selectedTreeNode.disabled)) { + if ((this.selectedTreeNode && this.selectedTreeNode.referenced === 'REF') || (this.selectedNode.disabled && this.selectedTreeNode.disabled)) { this.$warning(this.$t('api_test.scenario.scenario_warning')); } else { this.$warning(this.$t('api_test.scenario.scenario_step_warning'));