summary refs log tree commit diff
path: root/scripts/util
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2026-03-17 02:23:23 +0100
committerRory& <root@rory.gay>2026-03-17 02:23:23 +0100
commit4850d73e516c84added1175b8ae5ee178cede7a1 (patch)
tree8e83ff1f1fbf053b70ac239a5645aac224b2e087 /scripts/util
parentFix errorneous log (diff)
downloadserver-ts-4850d73e516c84added1175b8ae5ee178cede7a1.tar.xz
Color coded logging for missing request/response schemas in openapi
Diffstat (limited to 'scripts/util')
-rw-r--r--scripts/util/getRouteDescriptions.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/scripts/util/getRouteDescriptions.js b/scripts/util/getRouteDescriptions.js

index 69be334a..7ba0ec77 100644 --- a/scripts/util/getRouteDescriptions.js +++ b/scripts/util/getRouteDescriptions.js
@@ -44,10 +44,13 @@ function formatPath(path) { */ function proxy(file, apiMethod, apiPathPrefix, apiPath, ...args) { const opts = args.find((x) => x?.prototype?.OPTS_MARKER == true); - if (!opts) - return console.error( + if (!opts) { + console.error( ` \x1b[5m${bgYellow(black("WARN"))}\x1b[25m ${file.replace(path.resolve(__dirname, "..", "..", "dist"), "/src")} has route without route() description middleware: ${colorizeMethod(apiMethod)} ${formatPath(apiPath)}`, ); + routes.set(apiPathPrefix + apiPath + "|" + apiMethod, null); + return; + } console.log(`${colorizeMethod(apiMethod).padStart("DELETE".length + 10)} ${formatPath(apiPathPrefix + apiPath)}`); opts.file = file.replace("/dist/", "/src/").replace(".js", ".ts");