fix(接口定义): 修复jsonschema高级设置字段丢失的缺陷

--bug=1019655 --user=王孝刚 [接口测试]
github#19733在JSON-SCHEMA开启时编辑了高级设置字段,然后将JSON-SCHEMA关闭,高级字段属性丢失。
https://www.tapd.cn/55049933/s/1297827
This commit is contained in:
wxg0103 2022-11-17 17:37:52 +08:00 committed by lyh
parent 0bcb8e6587
commit 5d8f47f2eb
1 changed files with 2 additions and 1 deletions

View File

@ -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]
} }
} }