badmfck-api-server 3.0.9 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -96,7 +96,7 @@ async function Initializer(services) {
96
96
  exports.Initializer = Initializer;
97
97
  class APIService extends BaseService_1.BaseService {
98
98
  static nextLogID = 0;
99
- version = "3.0.9";
99
+ version = "3.1.0";
100
100
  options;
101
101
  monitor = null;
102
102
  monitorIndexFile;
@@ -32,11 +32,13 @@ class Validator {
32
32
  if (i.startsWith("$__"))
33
33
  continue;
34
34
  let type = typeof structure[i];
35
- let description = structure[i]['$__' + i] || "";
35
+ let description = structure['$__' + i] || "";
36
36
  let childs = undefined;
37
- let optional = structure[i]['$__optional_' + i] || "";
37
+ let optional = structure['$__optional_' + i] || "";
38
38
  if (optional === undefined)
39
39
  optional = structure[i] === null || structure[i] === undefined;
40
+ if (type === "object" && Array.isArray(structure[i]))
41
+ type = "array";
40
42
  if (typeof structure[i] === "object")
41
43
  childs = this.documentStructure(structure[i]);
42
44
  if (structure[i] === "@")
@@ -81,7 +83,7 @@ class Validator {
81
83
  foundKeys.push(i);
82
84
  continue;
83
85
  }
84
- let optional = structure[i]['$__optional_' + i] || false;
86
+ let optional = structure['$__optional_' + i] || false;
85
87
  if (!(i in object)) {
86
88
  if (!optional)
87
89
  errors.push("no field '" + i + "'");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "badmfck-api-server",
3
- "version": "3.0.9",
3
+ "version": "3.1.0",
4
4
  "description": "Simple API http server based on express",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",