fix: swagger 导入 code 判断bug

This commit is contained in:
gaoxiaolin.gao 2018-07-11 19:15:29 +08:00
parent 7a8367a322
commit 76702415d1

View File

@ -232,9 +232,10 @@ const swagger = require('swagger-client');
let codes = Object.keys(api);
let curCode;
if (codes.length > 0) {
if (codes.indexOf(200) > -1) {
curCode = 200;
if (codes.indexOf('200') > -1) {
curCode = '200';
} else curCode = codes[0];
let res = api[curCode];
if (res && typeof res === 'object') {
if (res.schema) {