Comparing version 0.27.1 to 0.28.0
# apiDoc Changelog | ||
### 0.28.0 | ||
* Use npm lockfile v2 | ||
* Update handlebar to fix vulnerability (#962) | ||
* Fix runtime error in single page template (#944 via #945 by Ashlanfox) | ||
* Implement apiBody parsing into multi page template (#953 by Seth Wheeler) | ||
### 0.27.0 | ||
@@ -4,0 +10,0 @@ * Maintain comment order for @apiParam and @apiSuccess (fix #206 via #951 by Matheus Giovani) |
{ | ||
"name": "apidoc", | ||
"version": "0.27.1", | ||
"version": "0.28.0", | ||
"description": "RESTful web API Documentation Generator", | ||
@@ -39,3 +39,3 @@ "author": "Peter Rottmann <rottmann@inveris.de>", | ||
"fs-extra": "^9.0.1", | ||
"handlebars": "^4.7.6", | ||
"handlebars": "^4.7.7", | ||
"lodash": "^4.17.20", | ||
@@ -42,0 +42,0 @@ "markdown-it": "^11.0.0", |
@@ -217,2 +217,42 @@ define([ | ||
*/ | ||
Handlebars.registerHelper('gen_body', function(context, options) { | ||
let strBody = {}; | ||
context.forEach(element => { | ||
element.field = element.field.replace("]", ""); | ||
switch (element.type.toLowerCase()) { | ||
case "string": | ||
if (element.field.includes('[')) { | ||
if (strBody[element.field.split("[")[0]] === undefined) { | ||
strBody[element.field.split("[")[0]] = {}; | ||
} | ||
strBody[element.field.split("[")[0]][element.field.split("[")[1]] = (element.defaultValue || ""); | ||
break; | ||
} | ||
strBody[element.field] = (element.defaultValue || ""); | ||
break; | ||
case "number": | ||
if (element.field.includes('[')) { | ||
if (strBody[element.field.split("[")[0]] === undefined) { | ||
strBody[element.field.split("[")[0]] = {}; | ||
} | ||
strBody[element.field.split("[")[0]][element.field.split("[")[1]] = (element.defaultValue || 0); | ||
break; | ||
} | ||
strBody[element.field] = (element.defaultValue || 0); | ||
break; | ||
case "object": | ||
if (strBody[element.field] === undefined) { | ||
strBody[element.field] = {}; | ||
} | ||
break; | ||
default: | ||
strBody[element.field] = null; | ||
} | ||
}); | ||
return JSON.stringify(strBody, null, 4); | ||
}); | ||
/** | ||
* | ||
*/ | ||
Handlebars.registerHelper('each_compare_field', function(source, compare, options) { | ||
@@ -219,0 +259,0 @@ return _handlebarsEachCompared('field', source, compare, options); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
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
1511572
4706
Updatedhandlebars@^4.7.7