fix(接口测试): 修复json转json-schema删除属性不生效问题
--bug=1014946 --user=赵勇 [接口测试]github#15843接口定义,在已有接口上用JSON格式新增字段,保存后切换到JSON-SCHEMA格式,新增的字段未增加 https://www.tapd.cn/55049933/s/1204201
This commit is contained in:
parent
18d28e8395
commit
5e2d516bcd
|
@ -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;
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in New Issue