fix (接口定义): case历史数据兼容处理
This commit is contained in:
parent
ec1b4bbdfd
commit
d7b0000505
|
@ -109,7 +109,7 @@ public class JSONSchemaGenerator {
|
||||||
concept.put(propertyName, analyzeEnumProperty(object));
|
concept.put(propertyName, analyzeEnumProperty(object));
|
||||||
} else if (propertyObjType.equals("string")) {
|
} else if (propertyObjType.equals("string")) {
|
||||||
// 先设置空值
|
// 先设置空值
|
||||||
concept.put(propertyName, null);
|
concept.put(propertyName, "");
|
||||||
if (object.has("format")) {
|
if (object.has("format")) {
|
||||||
String propertyFormat = object.get("format").getAsString();
|
String propertyFormat = object.get("format").getAsString();
|
||||||
if (propertyFormat.equals("date-time")) {
|
if (propertyFormat.equals("date-time")) {
|
||||||
|
|
|
@ -29,34 +29,55 @@
|
||||||
<el-row v-if="body.type == 'Form Data' || body.type == 'WWW_FORM'">
|
<el-row v-if="body.type == 'Form Data' || body.type == 'WWW_FORM'">
|
||||||
<el-link class="ms-el-link" @click="batchAdd"> {{ $t("commons.batch_add") }}</el-link>
|
<el-link class="ms-el-link" @click="batchAdd"> {{ $t("commons.batch_add") }}</el-link>
|
||||||
</el-row>
|
</el-row>
|
||||||
<ms-api-variable :with-mor-setting="true" :is-read-only="isReadOnly"
|
<ms-api-variable
|
||||||
|
:with-mor-setting="true"
|
||||||
|
:is-read-only="isReadOnly"
|
||||||
:parameters="body.kvs"
|
:parameters="body.kvs"
|
||||||
:isShowEnable="isShowEnable" type="body"/>
|
:isShowEnable="isShowEnable"
|
||||||
|
type="body"/>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="body.type == 'JSON'">
|
<div v-if="body.type == 'JSON'">
|
||||||
<div style="padding: 10px">
|
<div style="padding: 10px">
|
||||||
<el-switch active-text="JSON-SCHEMA" v-model="body.format" @change="formatChange" active-value="JSON-SCHEMA"/>
|
<el-switch active-text="JSON-SCHEMA" v-model="body.format" @change="formatChange" active-value="JSON-SCHEMA"/>
|
||||||
</div>
|
</div>
|
||||||
<ms-json-code-edit v-if="body.format==='JSON-SCHEMA'" :body="body" ref="jsonCodeEdit"/>
|
<ms-json-code-edit
|
||||||
<ms-code-edit v-else-if="codeEditActive" :read-only="isReadOnly" height="400px" :data.sync="body.raw" :modes="modes" :mode="'json'" ref="codeEdit"/>
|
v-if="body.format==='JSON-SCHEMA'"
|
||||||
|
:body="body"
|
||||||
|
ref="jsonCodeEdit"/>
|
||||||
|
<ms-code-edit
|
||||||
|
v-else-if="codeEditActive"
|
||||||
|
:read-only="isReadOnly"
|
||||||
|
:data.sync="body.raw"
|
||||||
|
:modes="modes"
|
||||||
|
:mode="'json'"
|
||||||
|
height="400px"
|
||||||
|
ref="codeEdit"/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="ms-body" v-if="body.type == 'XML'">
|
<div class="ms-body" v-if="body.type == 'XML'">
|
||||||
<ms-code-edit :read-only="isReadOnly" :data.sync="body.raw" :modes="modes" :mode="'text'" ref="codeEdit"/>
|
<ms-code-edit
|
||||||
|
:read-only="isReadOnly"
|
||||||
|
:data.sync="body.raw"
|
||||||
|
:modes="modes"
|
||||||
|
:mode="'text'"
|
||||||
|
ref="codeEdit"/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="ms-body" v-if="body.type == 'Raw'">
|
<div class="ms-body" v-if="body.type == 'Raw'">
|
||||||
<ms-code-edit :read-only="isReadOnly" :data.sync="body.raw" :modes="modes" ref="codeEdit"/>
|
<ms-code-edit
|
||||||
|
:read-only="isReadOnly"
|
||||||
|
:data.sync="body.raw"
|
||||||
|
:modes="modes"
|
||||||
|
ref="codeEdit"/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ms-api-binary-variable :is-read-only="isReadOnly"
|
<ms-api-binary-variable
|
||||||
|
:is-read-only="isReadOnly"
|
||||||
:parameters="body.binary"
|
:parameters="body.binary"
|
||||||
:isShowEnable="isShowEnable"
|
:isShowEnable="isShowEnable"
|
||||||
type="body"
|
type="body"
|
||||||
v-if="body.type == 'BINARY'"/>
|
v-if="body.type == 'BINARY'"/>
|
||||||
|
|
||||||
<batch-add-parameter @batchSave="batchSave" ref="batchAddParameter"/>
|
<batch-add-parameter @batchSave="batchSave" ref="batchAddParameter"/>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
|
@ -432,8 +432,10 @@ export default {
|
||||||
if (tmp.tags instanceof Array) {
|
if (tmp.tags instanceof Array) {
|
||||||
tmp.tags = JSON.stringify(tmp.tags);
|
tmp.tags = JSON.stringify(tmp.tags);
|
||||||
}
|
}
|
||||||
tmp.clazzName = TYPE_TO_C.get(tmp.type);
|
if (tmp.request) {
|
||||||
this.sort(tmp.hashTree);
|
tmp.request.clazzName = TYPE_TO_C.get(tmp.request.type);
|
||||||
|
this.sort(tmp.request.hashTree);
|
||||||
|
}
|
||||||
this.result = this.$fileUpload(url, null, bodyFiles, tmp, (response) => {
|
this.result = this.$fileUpload(url, null, bodyFiles, tmp, (response) => {
|
||||||
let data = response.data;
|
let data = response.data;
|
||||||
row.id = data.id;
|
row.id = data.id;
|
||||||
|
|
|
@ -67,6 +67,11 @@
|
||||||
<el-tab-pane :label="$t('api_test.definition.request.other_config')" name="advancedConfig">
|
<el-tab-pane :label="$t('api_test.definition.request.other_config')" name="advancedConfig">
|
||||||
<ms-api-advanced-config :is-read-only="isReadOnly" :request="request"/>
|
<ms-api-advanced-config :is-read-only="isReadOnly" :request="request"/>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
|
<!-- <el-tab-pane name="create" v-if="hasPermission('PROJECT_API_DEFINITION:READ+CREATE_API')">-->
|
||||||
|
<!-- <template v-slot:label>-->
|
||||||
|
<!-- <el-button size="mini" type="primary" @click.stop @click="createTestData">生成测试数据</el-button>-->
|
||||||
|
<!-- </template>-->
|
||||||
|
<!-- </el-tab-pane>-->
|
||||||
|
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
</div>
|
</div>
|
||||||
|
@ -93,6 +98,7 @@
|
||||||
import MsApiAdvancedConfig from "./ApiAdvancedConfig";
|
import MsApiAdvancedConfig from "./ApiAdvancedConfig";
|
||||||
import MsJsr233Processor from "../../../../automation/scenario/component/Jsr233Processor";
|
import MsJsr233Processor from "../../../../automation/scenario/component/Jsr233Processor";
|
||||||
import ApiDefinitionStepButton from "../components/ApiDefinitionStepButton";
|
import ApiDefinitionStepButton from "../components/ApiDefinitionStepButton";
|
||||||
|
import {hasPermission} from '@/common/js/utils';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "MsApiHttpRequestForm",
|
name: "MsApiHttpRequestForm",
|
||||||
|
@ -176,6 +182,10 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
hasPermission,
|
||||||
|
createTestData(){
|
||||||
|
|
||||||
|
},
|
||||||
remove(row) {
|
remove(row) {
|
||||||
let index = this.request.hashTree.indexOf(row);
|
let index = this.request.hashTree.indexOf(row);
|
||||||
this.request.hashTree.splice(index, 1);
|
this.request.hashTree.splice(index, 1);
|
||||||
|
|
Loading…
Reference in New Issue