fix(接口测试): 接口定义变更记录显示问题

--bug=1046196 --user=王旭 【接口测试】github#33019,接口定义中对请求体数据类型变更[String-number]变更记录中无对应的记录显示 https://www.tapd.cn/55049933/s/1626711
This commit is contained in:
WangXu10 2024-12-10 10:53:48 +08:00 committed by Craftsman
parent 6926f5deb9
commit 01c9a4dca0
1 changed files with 5 additions and 0 deletions

View File

@ -94,12 +94,17 @@ export default {
if (properties) {
for (let key in properties) {
let value = JSON.stringify(properties[key].mock);
let properType = properties[key]['**type']
if (value && value.indexOf('**mock') !== -1) {
properties['++' + key] = JSON.parse(JSON.stringify(properties[key]));
properties['--' + key] = JSON.parse(JSON.stringify(properties[key]));
properties['--' + key].mock = { mock: JSON.parse(value)['**mock'] };
delete properties[key];
}
if (value && properType) {
properties['--' + key].type = properType;
delete properties[key];
}
if (properties[key] && properties[key]['++description']) {
properties['++' + key] = JSON.parse(JSON.stringify(properties[key]));
properties['++' + key].description = properties[key]['++description'];