mirror of
https://github.com/YMFE/yapi.git
synced 2025-04-12 15:10:23 +08:00
swagger 导入数据时,如果数据格式中缺少 in 的参数,会丢失请求参数
如果不存在 in 的数据类型,默认按照 query 的参数导入
This commit is contained in:
parent
106d479ffd
commit
0e62eb5980
@ -190,6 +190,7 @@ const compareVersions = require('compare-versions');
|
||||
required: param.required ? '1' : '0'
|
||||
};
|
||||
|
||||
if (param.in) {
|
||||
switch (param.in) {
|
||||
case 'path':
|
||||
api.req_params.push(defaultParam);
|
||||
@ -208,6 +209,9 @@ const compareVersions = require('compare-versions');
|
||||
api.req_headers.push(defaultParam);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
api.req_query.push(defaultParam);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user