@tsed/swagger 8.0.0-rc.5 → 8.0.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.
- package/lib/esm/SwaggerModule.js +18 -46
- package/lib/esm/SwaggerModule.js.map +1 -1
- package/lib/esm/index.js +0 -1
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/services/SwaggerService.js +8 -12
- package/lib/esm/services/SwaggerService.js.map +1 -1
- package/lib/types/SwaggerModule.d.ts +4 -11
- package/lib/types/index.d.ts +0 -1
- package/lib/types/services/SwaggerService.d.ts +2 -2
- package/package.json +13 -16
- package/lib/esm/decorators/hidden.js +0 -36
- package/lib/esm/decorators/hidden.js.map +0 -1
- package/lib/types/decorators/hidden.d.ts +0 -32
package/lib/esm/SwaggerModule.js
CHANGED
|
@@ -1,26 +1,25 @@
|
|
|
1
|
-
import
|
|
1
|
+
import Fs from "node:fs";
|
|
2
|
+
import { join } from "node:path";
|
|
2
3
|
import { Env } from "@tsed/core";
|
|
3
|
-
import {
|
|
4
|
+
import { configuration, constant, inject, injectable, logger, ProviderType } from "@tsed/di";
|
|
4
5
|
import { normalizePath } from "@tsed/normalize-path";
|
|
5
|
-
import {
|
|
6
|
+
import { application } from "@tsed/platform-http";
|
|
6
7
|
import { PlatformRouter, useContextHandler } from "@tsed/platform-router";
|
|
7
|
-
import Fs from "fs";
|
|
8
|
-
import { join } from "path";
|
|
9
8
|
import { ROOT_DIR, SWAGGER_UI_DIST } from "./constants.js";
|
|
10
9
|
import { cssMiddleware } from "./middlewares/cssMiddleware.js";
|
|
11
10
|
import { indexMiddleware } from "./middlewares/indexMiddleware.js";
|
|
12
11
|
import { jsMiddleware } from "./middlewares/jsMiddleware.js";
|
|
13
12
|
import { redirectMiddleware } from "./middlewares/redirectMiddleware.js";
|
|
14
13
|
import { SwaggerService } from "./services/SwaggerService.js";
|
|
15
|
-
|
|
16
|
-
* @ignore
|
|
17
|
-
*/
|
|
18
|
-
let SwaggerModule = class SwaggerModule {
|
|
14
|
+
export class SwaggerModule {
|
|
19
15
|
constructor() {
|
|
16
|
+
this.swaggerService = inject(SwaggerService);
|
|
17
|
+
this.env = constant("env");
|
|
18
|
+
this.disableRoutesSummary = constant("logger.disableRoutesSummary");
|
|
20
19
|
this.loaded = false;
|
|
21
20
|
}
|
|
22
21
|
get settings() {
|
|
23
|
-
return
|
|
22
|
+
return constant("swagger", []).filter((o) => !!o);
|
|
24
23
|
}
|
|
25
24
|
/**
|
|
26
25
|
*
|
|
@@ -32,20 +31,20 @@ let SwaggerModule = class SwaggerModule {
|
|
|
32
31
|
const urls = this.getUrls();
|
|
33
32
|
this.settings.forEach((conf) => {
|
|
34
33
|
const { path = "/" } = conf;
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
application().use(path, useContextHandler(redirectMiddleware(path)));
|
|
35
|
+
application().use(path, this.createRouter(conf, urls));
|
|
37
36
|
});
|
|
38
37
|
this.loaded = true;
|
|
39
38
|
}
|
|
40
39
|
$onReady() {
|
|
41
40
|
// istanbul ignore next
|
|
42
|
-
if (
|
|
43
|
-
const host =
|
|
41
|
+
if (configuration().getBestHost && !this.disableRoutesSummary) {
|
|
42
|
+
const host = configuration().getBestHost();
|
|
44
43
|
const url = host.toString();
|
|
45
44
|
const displayLog = (conf) => {
|
|
46
45
|
const { path = "/", fileName = "swagger.json", doc } = conf;
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
logger().info(`[${doc || "default"}] Swagger JSON is available on ${url}${normalizePath(path, fileName)}`);
|
|
47
|
+
logger().info(`[${doc || "default"}] Swagger UI is available on ${url}${path}/`);
|
|
49
48
|
};
|
|
50
49
|
this.settings.forEach((conf) => {
|
|
51
50
|
displayLog(conf);
|
|
@@ -80,7 +79,7 @@ let SwaggerModule = class SwaggerModule {
|
|
|
80
79
|
*/
|
|
81
80
|
createRouter(conf, urls) {
|
|
82
81
|
const { disableSpec = false, fileName = "swagger.json", cssPath, jsPath, viewPath = join(ROOT_DIR, "../views/index.ejs") } = conf;
|
|
83
|
-
const router = new PlatformRouter(
|
|
82
|
+
const router = new PlatformRouter();
|
|
84
83
|
if (!disableSpec) {
|
|
85
84
|
router.get(normalizePath("/", fileName), useContextHandler(this.middlewareSwaggerJson(conf)));
|
|
86
85
|
}
|
|
@@ -101,33 +100,6 @@ let SwaggerModule = class SwaggerModule {
|
|
|
101
100
|
ctx.response.status(200).body(await this.swaggerService.getOpenAPISpec(conf));
|
|
102
101
|
};
|
|
103
102
|
}
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
Inject(),
|
|
107
|
-
__metadata("design:type", InjectorService)
|
|
108
|
-
], SwaggerModule.prototype, "injector", void 0);
|
|
109
|
-
__decorate([
|
|
110
|
-
Inject(),
|
|
111
|
-
__metadata("design:type", PlatformApplication)
|
|
112
|
-
], SwaggerModule.prototype, "app", void 0);
|
|
113
|
-
__decorate([
|
|
114
|
-
Configuration(),
|
|
115
|
-
__metadata("design:type", Object)
|
|
116
|
-
], SwaggerModule.prototype, "configuration", void 0);
|
|
117
|
-
__decorate([
|
|
118
|
-
Inject(),
|
|
119
|
-
__metadata("design:type", SwaggerService)
|
|
120
|
-
], SwaggerModule.prototype, "swaggerService", void 0);
|
|
121
|
-
__decorate([
|
|
122
|
-
Constant("env"),
|
|
123
|
-
__metadata("design:type", String)
|
|
124
|
-
], SwaggerModule.prototype, "env", void 0);
|
|
125
|
-
__decorate([
|
|
126
|
-
Constant("logger.disableRoutesSummary"),
|
|
127
|
-
__metadata("design:type", Boolean)
|
|
128
|
-
], SwaggerModule.prototype, "disableRoutesSummary", void 0);
|
|
129
|
-
SwaggerModule = __decorate([
|
|
130
|
-
Module()
|
|
131
|
-
], SwaggerModule);
|
|
132
|
-
export { SwaggerModule };
|
|
103
|
+
}
|
|
104
|
+
injectable(SwaggerModule).type(ProviderType.MODULE);
|
|
133
105
|
//# sourceMappingURL=SwaggerModule.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SwaggerModule.js","sourceRoot":"","sources":["../../src/SwaggerModule.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SwaggerModule.js","sourceRoot":"","sources":["../../src/SwaggerModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAC,IAAI,EAAC,MAAM,WAAW,CAAC;AAE/B,OAAO,EAAC,GAAG,EAAC,MAAM,YAAY,CAAC;AAC/B,OAAO,EAAC,aAAa,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,EAAC,MAAM,UAAU,CAAC;AAC3F,OAAO,EAAC,aAAa,EAAC,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAC,WAAW,EAAyC,MAAM,qBAAqB,CAAC;AACxF,OAAO,EAAC,cAAc,EAAE,iBAAiB,EAAC,MAAM,uBAAuB,CAAC;AAExE,OAAO,EAAC,QAAQ,EAAE,eAAe,EAAC,MAAM,gBAAgB,CAAC;AAEzD,OAAO,EAAC,aAAa,EAAC,MAAM,gCAAgC,CAAC;AAC7D,OAAO,EAAC,eAAe,EAAC,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAC,YAAY,EAAC,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAC,kBAAkB,EAAC,MAAM,qCAAqC,CAAC;AACvE,OAAO,EAAC,cAAc,EAAC,MAAM,8BAA8B,CAAC;AAE5D,MAAM,OAAO,aAAa;IAA1B;QACY,mBAAc,GAAG,MAAM,CAAC,cAAc,CAAC,CAAC;QACxC,QAAG,GAAG,QAAQ,CAAM,KAAK,CAAC,CAAC;QAC3B,yBAAoB,GAAG,QAAQ,CAAU,6BAA6B,CAAC,CAAC;QAE1E,WAAM,GAAG,KAAK,CAAC;IA4GzB,CAAC;IA1GC,IAAI,QAAQ;QACV,OAAO,QAAQ,CAAoB,SAAS,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,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AAM,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC;QAChF,CAAC,CAAC;IACJ,CAAC;CACF;AAED,UAAU,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC"}
|
package/lib/esm/index.js
CHANGED
package/lib/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iCAAiC,CAAC;AAChD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,kCAAkC,CAAC;AACjD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,qCAAqC,CAAC;AACpD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { constant, Injectable } from "@tsed/di";
|
|
1
|
+
import { constant, inject, injectable } from "@tsed/di";
|
|
3
2
|
import { Platform } from "@tsed/platform-http";
|
|
4
3
|
import { generateSpec } from "@tsed/schema";
|
|
5
4
|
import { includeRoute } from "../utils/includeRoute.js";
|
|
6
5
|
import { readSpec } from "../utils/readSpec.js";
|
|
7
|
-
|
|
8
|
-
#specs
|
|
9
|
-
constructor(
|
|
10
|
-
this.platform =
|
|
6
|
+
export class SwaggerService {
|
|
7
|
+
#specs;
|
|
8
|
+
constructor() {
|
|
9
|
+
this.platform = inject(Platform);
|
|
10
|
+
this.#specs = new Map();
|
|
11
11
|
}
|
|
12
12
|
async getOpenAPISpec(conf) {
|
|
13
13
|
if (!this.#specs.has(conf.path)) {
|
|
@@ -29,10 +29,6 @@ let SwaggerService = class SwaggerService {
|
|
|
29
29
|
}
|
|
30
30
|
return this.#specs.get(conf.path);
|
|
31
31
|
}
|
|
32
|
-
}
|
|
33
|
-
SwaggerService
|
|
34
|
-
Injectable(),
|
|
35
|
-
__metadata("design:paramtypes", [Platform])
|
|
36
|
-
], SwaggerService);
|
|
37
|
-
export { SwaggerService };
|
|
32
|
+
}
|
|
33
|
+
injectable(SwaggerService);
|
|
38
34
|
//# sourceMappingURL=SwaggerService.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SwaggerService.js","sourceRoot":"","sources":["../../../src/services/SwaggerService.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SwaggerService.js","sourceRoot":"","sources":["../../../src/services/SwaggerService.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAC,MAAM,UAAU,CAAC;AAEtD,OAAO,EAAC,QAAQ,EAAC,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAC,YAAY,EAAC,MAAM,cAAc,CAAC;AAG1C,OAAO,EAAC,YAAY,EAAC,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAC,QAAQ,EAAC,MAAM,sBAAsB,CAAC;AAE9C,MAAM,OAAO,cAAc;IAGzB,MAAM,CAAiD;IAEvD;QAJU,aAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;QAEtC,WAAM,GAAuC,IAAI,GAAG,EAAE,CAAC;IAExC,CAAC;IAST,KAAK,CAAC,cAAc,CAAC,IAAqB;QAC/C,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;YAChC,MAAM,OAAO,GAAG,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;YAC7C,MAAM,WAAW,GAAG,QAAQ,CAAS,aAAa,CAAC,CAAC;YACpD,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;YAE/B,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ;iBACzB,qBAAqB,EAAE;iBACvB,MAAM,CAAC,CAAC,EAAC,MAAM,EAAE,QAAQ,EAAC,EAAE,EAAE,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,YAAY,CAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC;iBACzG,GAAG,CAAC,CAAC,EAAC,KAAK,EAAE,QAAQ,EAAC,EAAE,EAAE,CAAC,CAAC,EAAC,KAAK,EAAE,QAAQ,CAAC,KAAa,EAAE,QAAQ,EAAE,KAAK,EAAC,CAAC,CAAC,CAAC;YAElF,MAAM,IAAI,GAAG,YAAY,CAAC;gBACxB,MAAM;gBACN,GAAG,IAAI;gBACP,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,MAAM,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE;gBAClD,OAAO;gBACP,WAAW;aACZ,CAAC,CAAC;YAEH,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QACnC,CAAC;QAED,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACpC,CAAC;CACF;AAED,UAAU,CAAC,cAAc,CAAC,CAAC"}
|
|
@@ -1,18 +1,11 @@
|
|
|
1
1
|
import { Env } from "@tsed/core";
|
|
2
|
-
import {
|
|
3
|
-
import { OnReady, OnRoutesInit, PlatformApplication } from "@tsed/platform-http";
|
|
2
|
+
import { OnReady, OnRoutesInit } from "@tsed/platform-http";
|
|
4
3
|
import { SwaggerSettings } from "./interfaces/SwaggerSettings.js";
|
|
5
4
|
import { SwaggerService } from "./services/SwaggerService.js";
|
|
6
|
-
/**
|
|
7
|
-
* @ignore
|
|
8
|
-
*/
|
|
9
5
|
export declare class SwaggerModule implements OnRoutesInit, OnReady {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
swaggerService: SwaggerService;
|
|
14
|
-
env: Env;
|
|
15
|
-
disableRoutesSummary: boolean;
|
|
6
|
+
protected swaggerService: SwaggerService;
|
|
7
|
+
protected env: Env | undefined;
|
|
8
|
+
protected disableRoutesSummary: boolean | undefined;
|
|
16
9
|
private loaded;
|
|
17
10
|
get settings(): SwaggerSettings[];
|
|
18
11
|
/**
|
package/lib/types/index.d.ts
CHANGED
|
@@ -3,8 +3,8 @@ import { Platform } from "@tsed/platform-http";
|
|
|
3
3
|
import { SwaggerOS2Settings, SwaggerOS3Settings, SwaggerSettings } from "../interfaces/SwaggerSettings.js";
|
|
4
4
|
export declare class SwaggerService {
|
|
5
5
|
#private;
|
|
6
|
-
|
|
7
|
-
constructor(
|
|
6
|
+
protected platform: Platform;
|
|
7
|
+
constructor();
|
|
8
8
|
/**
|
|
9
9
|
* Generate Spec for the given configuration
|
|
10
10
|
* @returns {Spec}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@tsed/swagger",
|
|
3
3
|
"description": "Swagger package for Ts.ED framework",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"version": "8.0.0
|
|
5
|
+
"version": "8.0.0",
|
|
6
6
|
"source": "./src/index.ts",
|
|
7
7
|
"main": "./lib/esm/index.js",
|
|
8
8
|
"module": "./lib/esm/index.js",
|
|
@@ -25,23 +25,23 @@
|
|
|
25
25
|
"test:ci": "vitest run --coverage.thresholds.autoUpdate=true"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@tsed/normalize-path": "8.0.0
|
|
29
|
-
"@tsed/openspec": "8.0.0
|
|
28
|
+
"@tsed/normalize-path": "8.0.0",
|
|
29
|
+
"@tsed/openspec": "8.0.0",
|
|
30
30
|
"fs-extra": "11.2.0",
|
|
31
31
|
"micromatch": "4.0.8",
|
|
32
32
|
"swagger-ui-dist": ">=5.17.14",
|
|
33
33
|
"tslib": "2.7.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@tsed/barrels": "8.0.0
|
|
37
|
-
"@tsed/core": "8.0.0
|
|
38
|
-
"@tsed/di": "8.0.0
|
|
39
|
-
"@tsed/json-mapper": "8.0.0
|
|
36
|
+
"@tsed/barrels": "8.0.0",
|
|
37
|
+
"@tsed/core": "8.0.0",
|
|
38
|
+
"@tsed/di": "8.0.0",
|
|
39
|
+
"@tsed/json-mapper": "8.0.0",
|
|
40
40
|
"@tsed/monorepo-utils": "2.3.9",
|
|
41
|
-
"@tsed/openspec": "8.0.0
|
|
42
|
-
"@tsed/platform-http": "8.0.0
|
|
43
|
-
"@tsed/schema": "8.0.0
|
|
44
|
-
"@tsed/typescript": "8.0.0
|
|
41
|
+
"@tsed/openspec": "8.0.0",
|
|
42
|
+
"@tsed/platform-http": "8.0.0",
|
|
43
|
+
"@tsed/schema": "8.0.0",
|
|
44
|
+
"@tsed/typescript": "8.0.0",
|
|
45
45
|
"@types/swagger-ui-dist": "3.30.5",
|
|
46
46
|
"eslint": "9.12.0",
|
|
47
47
|
"ts-node": "10.9.2",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"vitest": "2.1.2"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
|
-
"@tsed/platform-http": "8.0.0
|
|
52
|
+
"@tsed/platform-http": "8.0.0"
|
|
53
53
|
},
|
|
54
54
|
"peerDependenciesMeta": {
|
|
55
55
|
"@tsed/common": {
|
|
@@ -62,8 +62,5 @@
|
|
|
62
62
|
},
|
|
63
63
|
"homepage": "https://github.com/tsedio/tsed/tree/production/packages/specs/swagger",
|
|
64
64
|
"author": "Romain Lenzotti",
|
|
65
|
-
"license": "MIT"
|
|
66
|
-
"publishConfig": {
|
|
67
|
-
"tag": "rc"
|
|
68
|
-
}
|
|
65
|
+
"license": "MIT"
|
|
69
66
|
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { Hidden as H } from "@tsed/schema";
|
|
2
|
-
/**
|
|
3
|
-
* Disable documentation for the class and his endpoint.
|
|
4
|
-
*
|
|
5
|
-
* ````typescript
|
|
6
|
-
* @Controller('/')
|
|
7
|
-
* export class Ctrl {
|
|
8
|
-
*
|
|
9
|
-
* @Get('/')
|
|
10
|
-
* @Hidden()
|
|
11
|
-
* hiddenRoute(){
|
|
12
|
-
*
|
|
13
|
-
* }
|
|
14
|
-
* }
|
|
15
|
-
*
|
|
16
|
-
* @Controller('/')
|
|
17
|
-
* @Hidden()
|
|
18
|
-
* export class Ctrl {
|
|
19
|
-
* @Get('/')
|
|
20
|
-
* hiddenRoute() {
|
|
21
|
-
*
|
|
22
|
-
* }
|
|
23
|
-
* @Get('/2')
|
|
24
|
-
* hiddenRoute2() {
|
|
25
|
-
*
|
|
26
|
-
* }
|
|
27
|
-
* }
|
|
28
|
-
* ```
|
|
29
|
-
*
|
|
30
|
-
* @decorator
|
|
31
|
-
* @swagger
|
|
32
|
-
*/
|
|
33
|
-
export function Hidden() {
|
|
34
|
-
return H();
|
|
35
|
-
}
|
|
36
|
-
//# sourceMappingURL=hidden.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hidden.js","sourceRoot":"","sources":["../../../src/decorators/hidden.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,IAAI,CAAC,EAAC,MAAM,cAAc,CAAC;AAEzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,MAAM,UAAU,MAAM;IACpB,OAAO,CAAC,EAAE,CAAC;AACb,CAAC"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Disable documentation for the class and his endpoint.
|
|
3
|
-
*
|
|
4
|
-
* ````typescript
|
|
5
|
-
* @Controller('/')
|
|
6
|
-
* export class Ctrl {
|
|
7
|
-
*
|
|
8
|
-
* @Get('/')
|
|
9
|
-
* @Hidden()
|
|
10
|
-
* hiddenRoute(){
|
|
11
|
-
*
|
|
12
|
-
* }
|
|
13
|
-
* }
|
|
14
|
-
*
|
|
15
|
-
* @Controller('/')
|
|
16
|
-
* @Hidden()
|
|
17
|
-
* export class Ctrl {
|
|
18
|
-
* @Get('/')
|
|
19
|
-
* hiddenRoute() {
|
|
20
|
-
*
|
|
21
|
-
* }
|
|
22
|
-
* @Get('/2')
|
|
23
|
-
* hiddenRoute2() {
|
|
24
|
-
*
|
|
25
|
-
* }
|
|
26
|
-
* }
|
|
27
|
-
* ```
|
|
28
|
-
*
|
|
29
|
-
* @decorator
|
|
30
|
-
* @swagger
|
|
31
|
-
*/
|
|
32
|
-
export declare function Hidden(): Function;
|