Skip to content

Commit

Permalink
过滤非.json结尾的地址:
Browse files Browse the repository at this point in the history
  • Loading branch information
walkerwzy committed Jan 19, 2018
1 parent 8a02ce1 commit 92c6d88
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ function parseRequestTable(table) {

// 根据解析出路径, 响应类型, 和参数数组
function parseEndpoints(uris){
endpoints = uris.match(/\/[a-zA-Z]+.*?\.json/ig).map(m=>m.replace('}','')); // 从文档中提取接口地址
endpoints = uris.match(/\/[\w\/\.]+/ig).map(m=>m.replace('}','')).filter(m=>m.indexOf('.json')>0); // 从文档中提取接口地址
responseModel = endpoints.map(e=>'Response'+e.replace(/\/(\w)/ig,underscoreToCamel).replace('.json','')) // 从接口地址生成返回值名
methods = endpoints.map(e=>'method'+e.replace(/\/(\w)/ig,underscoreToCamel).replace('.json','')); // 从接口地址生成方法名
}
Expand Down

0 comments on commit 92c6d88

Please sign in to comment.