fix(接口测试): 修复json转json-schema删除属性不生效问题

--bug=1014946 --user=赵勇 [接口测试]github#15843接口定义,在已有接口上用JSON格式新增字段,保存后切换到JSON-SCHEMA格式,新增的字段未增加 https://www.tapd.cn/55049933/s/1204201
This commit is contained in:
fit2-zhao 2022-07-19 16:08:15 +08:00 committed by f2c-ci-robot[bot]
parent 18d28e8395
commit 5e2d516bcd
1 changed files with 6 additions and 4 deletions

View File

@ -178,7 +178,6 @@ export default {
to[key] = this.assign(Object(to[key]), from[key]);
}
},
assign(to, from) {
if (to === from) {
return to;
@ -189,17 +188,20 @@ export default {
this.assignKey(to, from, key);
}
}
//
for (let key in to) {
if (!this.hasOwnProperty.call(from, key) && key !== 'description') {
this.$delete(to, key)
}
}
if (Object.getOwnPropertySymbols) {
let symbols = Object.getOwnPropertySymbols(from);
for (let i = 0; i < symbols.length; i++) {
if (this.propIsEnumerable.call(from, symbols[i])) {
this.assignKey(to, from, symbols[i]);
}
}
}
return to;
},