badmfck-api-server 4.1.4 → 4.1.5
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.
|
@@ -38,16 +38,21 @@ class DocumentGenerator {
|
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
40
|
else if (typeof j.handler === "object") {
|
|
41
|
-
for (
|
|
42
|
-
const
|
|
43
|
-
if (
|
|
41
|
+
for (const method in j.handler) {
|
|
42
|
+
const methodHandler = j.handler[method];
|
|
43
|
+
if (!methodHandler)
|
|
44
44
|
continue;
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
45
|
+
const meta = typeof methodHandler === "object" ? methodHandler : null;
|
|
46
|
+
if (meta && (meta.ignoreInDocumentation || meta.ignoreHttpLogging))
|
|
47
|
+
continue;
|
|
48
|
+
const validationModel = meta?.validationModel ?? j.validationModel;
|
|
49
|
+
const resultModel = meta?.resultModel ?? j.resultModel;
|
|
50
|
+
endpoint.methods[method.toUpperCase()] = {
|
|
51
|
+
title: meta?.title || j.title || "",
|
|
52
|
+
description: meta?.description || j.description,
|
|
53
|
+
parameters: Validator_1.Validator.documentStructure(validationModel),
|
|
54
|
+
authorized: !(meta?.ignoreInterceptor ?? j.ignoreInterceptor),
|
|
55
|
+
returns: resultModel ? Validator_1.Validator.documentStructure(resultModel) : undefined
|
|
51
56
|
};
|
|
52
57
|
}
|
|
53
58
|
}
|