express-swagger-generator
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -30,3 +30,2 @@ /** | ||
} | ||
function parseRoute(str) { | ||
@@ -92,2 +91,11 @@ let split = str.split(" ") | ||
function parseProduces(str) { | ||
return str.split(/\s+/); | ||
} | ||
function parseConsumes(str) { | ||
return str.split(/\s+/); | ||
} | ||
function parseTypedef(tags){ | ||
@@ -155,4 +163,23 @@ const typeName = tags[0]['name']; | ||
} | ||
parameters[route.uri][route.method]['parameters'] = params; | ||
parameters[route.uri][route.method]['responses'] = parseReturn(comments[i]); | ||
if (title == 'operationId' && route) { | ||
parameters[route.uri][route.method]['operationId'] = comments[i][j]['description']; | ||
} | ||
if (title == 'summary' && route) { | ||
parameters[route.uri][route.method]['summary'] = comments[i][j]['description']; | ||
} | ||
if (title == 'produces' && route) { | ||
parameters[route.uri][route.method]['produces'] = parseProduces(comments[i][j]['description']); | ||
} | ||
if (title == 'consumes' && route) { | ||
parameters[route.uri][route.method]['consumes'] = parseConsumes(comments[i][j]['description']); | ||
} | ||
if (route) { | ||
parameters[route.uri][route.method]['parameters'] = params; | ||
parameters[route.uri][route.method]['responses'] = parseReturn(comments[i]); | ||
} | ||
} | ||
@@ -159,0 +186,0 @@ } |
{ | ||
"name": "express-swagger-generator", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Generates swagger doc & ui based on express existing routes.", | ||
"main": "index.js", | ||
"scripts": { | ||
}, | ||
"scripts": {}, | ||
"repository": { | ||
@@ -10,0 +8,0 @@ "type": "git", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18065
480