diff --git a/backend/pom.xml b/backend/pom.xml index b1ac25f1f5..2e0bb201d4 100644 --- a/backend/pom.xml +++ b/backend/pom.xml @@ -217,7 +217,7 @@ io.metersphere jmeter-plugins-dubbo - 2.7.8 + 2.7.9 diff --git a/backend/src/main/java/io/metersphere/api/parse/Swagger2Parser.java b/backend/src/main/java/io/metersphere/api/parse/Swagger2Parser.java index 11e8320afe..a9338a6ddf 100644 --- a/backend/src/main/java/io/metersphere/api/parse/Swagger2Parser.java +++ b/backend/src/main/java/io/metersphere/api/parse/Swagger2Parser.java @@ -126,8 +126,15 @@ public class Swagger2Parser extends ApiImportAbstractParser { Model schema = bodyParameter.getSchema(); if (schema instanceof RefModel) { + String simpleRef = ""; RefModel refModel = (RefModel) bodyParameter.getSchema(); - Model model = definitions.get(refModel.getSimpleRef()); + String originalRef = refModel.getOriginalRef(); + if (refModel.getOriginalRef().split("/").length > 3) { + simpleRef = originalRef.replace("#/definitions/", ""); + } else { + simpleRef = refModel.getSimpleRef(); + } + Model model = definitions.get(simpleRef); JSONObject bodyParameters = getBodyJSONObjectParameters(model.getProperties(), definitions); body.setRaw(bodyParameters.toJSONString()); } else if (schema instanceof ArrayModel) { diff --git a/frontend/src/business/components/api/test/ApiTestConfig.vue b/frontend/src/business/components/api/test/ApiTestConfig.vue index ab1d4cd63f..5461bc7034 100644 --- a/frontend/src/business/components/api/test/ApiTestConfig.vue +++ b/frontend/src/business/components/api/test/ApiTestConfig.vue @@ -157,13 +157,9 @@ saveTest() { this.save(() => { this.$success(this.$t('commons.save_success')); - if (this.create) { - this.$router.push({ - path: '/api/test/edit?id=' + this.test.id - }) - } else { - this.$router.push({path: '/api/test/list/all'}) - } + this.$router.push({ + path: '/api/test/edit?id=' + this.test.id + }) }) }, runTest() { @@ -183,7 +179,6 @@ }) }, cancel() { - // console.log(this.test.toJMX().xml) this.$router.push('/api/test/list/all'); }, getOptions(url) { diff --git a/frontend/src/business/components/common/components/MsAsideContainer.vue b/frontend/src/business/components/common/components/MsAsideContainer.vue index 982a542550..90d9ec7e9b 100644 --- a/frontend/src/business/components/common/components/MsAsideContainer.vue +++ b/frontend/src/business/components/common/components/MsAsideContainer.vue @@ -1,9 +1,9 @@