fix(接口定义): 修复jsonschema高级设置字段丢失的缺陷
--bug=1019655 --user=王孝刚 [接口测试] github#19733在JSON-SCHEMA开启时编辑了高级设置字段,然后将JSON-SCHEMA关闭,高级字段属性丢失。 https://www.tapd.cn/55049933/s/1297827
This commit is contained in:
parent
0bcb8e6587
commit
5d8f47f2eb
|
@ -190,9 +190,10 @@ export default {
|
||||||
this.assignKey(to, from, key);
|
this.assignKey(to, from, key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
let property = ['description', 'maxLength', 'minLength', 'pattern', 'format', 'enum', 'default'];
|
||||||
// 清除多出部分属性
|
// 清除多出部分属性
|
||||||
for (let key in to) {
|
for (let key in to) {
|
||||||
if (!this.hasOwnProperty.call(from, key) && key !== 'description') {
|
if (!this.hasOwnProperty.call(from, key) && property.indexOf(key) === -1) {
|
||||||
delete to[key]
|
delete to[key]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue