We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 59bade3 commit b106f0aCopy full SHA for b106f0a
exts/yapi-plugin-import-swagger/run.js
@@ -154,6 +154,18 @@ const compareVersions = require('compare-versions');
154
api.title = data.summary || data.path;
155
api.desc = data.description;
156
api.catname = null;
157
+
158
+ // 处理 swagger 扩展属性
159
+ // 如: x-yapi-status 映射为 yapi status字段
160
+ const extPrefix = 'x-yapi-';
161
+ _.each(api, (value, extfield) => {
162
+ if (extfield.startsWith(extPrefix)) {
163
+ const yapiField = extfield.replace(extPrefix, '');
164
+ api[yapiField] = value;
165
+ delete api[yapiField];
166
+ }
167
+ })
168
169
if(data.tags && Array.isArray(data.tags)){
170
api.tag = data.tags;
171
for(let i=0; i< data.tags.length; i++){
0 commit comments