express-swagger-generator
Advanced tools
Comparing version 1.1.14 to 1.1.15
@@ -5,2 +5,2 @@ /** | ||
module.exports = require('./lib/swagger'); | ||
module.exports = require('./lib/swagger').generateSpecAndMount; |
@@ -152,3 +152,5 @@ /** | ||
function parseDescription(obj) { | ||
return obj.description || '' | ||
const description = obj.description || ''; | ||
const sanitizedDescription = description.replace('/**',''); | ||
return sanitizedDescription; | ||
} | ||
@@ -417,3 +419,3 @@ | ||
*/ | ||
module.exports = function (app) { | ||
function generateSpecAndMount(app) { | ||
@@ -441,9 +443,12 @@ return function (options) { | ||
for (let j in comments) { | ||
let parsed = fileFormat(comments[j]) | ||
swaggerHelpers.addDataToSwaggerObject(swaggerObject, [{ | ||
paths: parsed.parameters, | ||
tags: parsed.tags, | ||
definitions: parsed.definitions | ||
}]); | ||
try { | ||
let parsed = fileFormat(comments[j]) | ||
swaggerHelpers.addDataToSwaggerObject(swaggerObject, [{ | ||
paths: parsed.parameters, | ||
tags: parsed.tags, | ||
definitions: parsed.definitions | ||
}]); | ||
} catch (e) { | ||
console.log(`Incorrect comment format. Method was not documented.\nFile: ${apiFiles[i]}\nComment:`, comments[j]) | ||
} | ||
} | ||
@@ -471,1 +476,8 @@ } | ||
}; | ||
module.exports = { | ||
generateSpecAndMount, | ||
fileFormat, | ||
parseApiFile | ||
}; |
{ | ||
"name": "express-swagger-generator", | ||
"version": "1.1.14", | ||
"version": "1.1.15", | ||
"description": "Generates swagger doc & ui based on express existing routes.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
29419
714