Skip to content

Commit

Permalink
Merge pull request #932 from samchon/features/swagger-customizer
Browse files Browse the repository at this point in the history
Fix `@SwaggerCuztomizer()` bug of `@internal` tagged.
  • Loading branch information
samchon authored Jun 24, 2024
2 parents 16e291b + e7e4d6b commit 3cc636d
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 29 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "@nestia/station",
"version": "3.2.5",
"version": "3.2.6",
"description": "Nestia station",
"scripts": {
"build": "node build/index.js",
Expand Down
6 changes: 3 additions & 3 deletions packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nestia/core",
"version": "3.2.5",
"version": "3.2.6",
"description": "Super-fast validation decorators of NestJS",
"main": "lib/index.js",
"typings": "lib/index.d.ts",
Expand Down Expand Up @@ -36,7 +36,7 @@
},
"homepage": "https://nestia.io",
"dependencies": {
"@nestia/fetcher": "^3.2.5",
"@nestia/fetcher": "^3.2.6",
"@nestjs/common": ">=7.0.1",
"@nestjs/core": ">=7.0.1",
"@samchon/openapi": "^0.1.21",
Expand All @@ -53,7 +53,7 @@
"ws": "^7.5.3"
},
"peerDependencies": {
"@nestia/fetcher": ">=3.2.5",
"@nestia/fetcher": ">=3.2.6",
"@nestjs/common": ">=7.0.1",
"@nestjs/core": ">=7.0.1",
"reflect-metadata": ">=0.1.12",
Expand Down
2 changes: 1 addition & 1 deletion packages/fetcher/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nestia/fetcher",
"version": "3.2.5",
"version": "3.2.6",
"description": "Fetcher library of Nestia SDK",
"main": "lib/index.js",
"typings": "lib/index.d.ts",
Expand Down
6 changes: 3 additions & 3 deletions packages/sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nestia/sdk",
"version": "3.2.5",
"version": "3.2.6",
"description": "Nestia SDK and Swagger generator",
"main": "lib/index.js",
"typings": "lib/index.d.ts",
Expand Down Expand Up @@ -32,7 +32,7 @@
},
"homepage": "https://nestia.io",
"dependencies": {
"@nestia/fetcher": "^3.2.5",
"@nestia/fetcher": "^3.2.6",
"@samchon/openapi": "^0.1.21",
"cli": "^1.0.1",
"get-function-location": "^2.0.0",
Expand All @@ -46,7 +46,7 @@
"typia": "^6.0.3"
},
"peerDependencies": {
"@nestia/fetcher": ">=3.2.5",
"@nestia/fetcher": ">=3.2.6",
"@nestjs/common": ">=7.0.1",
"@nestjs/core": ">=7.0.1",
"reflect-metadata": ">=0.1.12",
Expand Down
10 changes: 8 additions & 2 deletions packages/sdk/src/generates/SwaggerGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,13 @@ export namespace SwaggerGenerator {
const method: OpenApi.Method =
route.method.toLowerCase() as OpenApi.Method;
const path: string = get_path(route.path, route.parameters);
const operation: OpenApi.IOperation | undefined =
swagger.paths?.[path]?.[method];
if (operation === undefined) continue;
functor.set(route.function, {
method,
path,
route: swagger.paths![path][method]!,
route: operation,
});
}
return functor;
Expand Down Expand Up @@ -182,7 +185,10 @@ export namespace SwaggerGenerator {
const path: string = get_path(route.path, route.parameters);
const method: OpenApi.Method =
route.method.toLowerCase() as OpenApi.Method;
const target: OpenApi.IOperation = swagger.paths![path][method]!;
const target: OpenApi.IOperation | undefined =
swagger.paths?.[path]?.[method];
if (target === undefined) continue;

const closure: Function | Function[] = Reflect.getMetadata(
"nestia/SwaggerCustomizer",
route.controller.prototype,
Expand Down
8 changes: 4 additions & 4 deletions test/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "@nestia/test",
"version": "3.2.5",
"version": "3.2.6",
"description": "Test program of Nestia",
"main": "index.js",
"scripts": {
Expand All @@ -26,7 +26,7 @@
},
"homepage": "https://nestia.io",
"devDependencies": {
"@nestia/sdk": "^3.2.5",
"@nestia/sdk": "^3.2.6",
"@nestjs/swagger": "^7.1.2",
"@samchon/openapi": "^0.1.21",
"@types/express": "^4.17.17",
Expand All @@ -40,9 +40,9 @@
},
"dependencies": {
"@fastify/multipart": "^8.1.0",
"@nestia/core": "^3.2.5",
"@nestia/core": "^3.2.6",
"@nestia/e2e": "^0.3.6",
"@nestia/fetcher": "^3.2.5",
"@nestia/fetcher": "^3.2.6",
"@nestjs/common": "^10.3.5",
"@nestjs/core": "^10.3.5",
"@nestjs/platform-express": "^10.3.5",
Expand Down
30 changes: 15 additions & 15 deletions website/deploy.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
const cp = require('child_process');
const deploy = require('gh-pages');
const cp = require("child_process");
const deploy = require("gh-pages");

cp.execSync('npm run build', { stdio: 'inherit' });
cp.execSync("npm run build", { stdio: "inherit" });

deploy.publish(
"out",
{
branch: "gh-pages",
dotfiles: true,
},
(err) => {
if (err) {
console.log(err);
process.exit(-1);
} else clear();
}
);
"out",
{
branch: "gh-pages",
dotfiles: true,
},
(err) => {
if (err) {
console.log(err);
process.exit(-1);
} else clear();
},
);

0 comments on commit 3cc636d

Please sign in to comment.