Skip to content

Commit

Permalink
Merge pull request #813 from samchon/features/summary
Browse files Browse the repository at this point in the history
Fix samchon/typia@976 - wrong `ISwaggerRoute.summary` inference.
  • Loading branch information
samchon authored Feb 23, 2024
2 parents bb3e044 + c0712b2 commit 20c82a1
Show file tree
Hide file tree
Showing 18 changed files with 346 additions and 30 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Check out the document in the [website](https://nestia.io/docs/):
- [TypedException](https://nestia.io/docs/core/TypedException/)
- Generators
- [Swagger Documents](https://nestia.io/docs/sdk/swagger/)
- [SDK Library](https://nestia.io/docs/sdk/sdk/)
- [Software Development Kit](https://nestia.io/docs/sdk/sdk/)
- [E2E Functions](https://nestia.io/docs/sdk/e2e/)
- [Mockup Simulator](https://nestia.io/docs/sdk/simulator/)
- [Swagger to NestJS](https://nestia.io/docs/migrate/)
Expand Down
2 changes: 1 addition & 1 deletion benchmark/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"homepage": "https://nestia.io",
"dependencies": {
"@nestia/core": "^2.4.3",
"typia": "^5.4.5"
"typia": "^5.4.12"
},
"devDependencies": {
"@types/autocannon": "^7.9.0",
Expand Down
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": "2.5.9",
"version": "2.5.10",
"description": "Nestia station",
"main": "prettier.config.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Check out the document in the [website](https://nestia.io/docs/):
- [TypedException](https://nestia.io/docs/core/TypedException/)
- Generators
- [Swagger Documents](https://nestia.io/docs/sdk/swagger/)
- [SDK Library](https://nestia.io/docs/sdk/sdk/)
- [Software Development Kit](https://nestia.io/docs/sdk/sdk/)
- [E2E Functions](https://nestia.io/docs/sdk/e2e/)
- [Mockup Simulator](https://nestia.io/docs/sdk/simulator/)
- [Swagger to NestJS](https://nestia.io/docs/migrate/)
Expand Down
10 changes: 5 additions & 5 deletions packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nestia/core",
"version": "2.5.9",
"version": "2.5.10",
"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": "^2.5.9",
"@nestia/fetcher": "^2.5.10",
"@nestjs/common": ">=7.0.1",
"@nestjs/core": ">=7.0.1",
"detect-ts-node": "^1.0.5",
Expand All @@ -45,15 +45,15 @@
"raw-body": "^2.0.0",
"reflect-metadata": ">=0.1.12",
"rxjs": ">=6.0.0",
"typia": "^5.4.5"
"typia": "^5.4.12"
},
"peerDependencies": {
"@nestia/fetcher": ">=2.5.9",
"@nestia/fetcher": ">=2.5.10",
"@nestjs/common": ">=7.0.1",
"@nestjs/core": ">=7.0.1",
"reflect-metadata": ">=0.1.12",
"rxjs": ">=6.0.0",
"typia": ">=5.4.5 <6.0.0"
"typia": ">=5.4.12 <6.0.0"
},
"devDependencies": {
"@fastify/multipart": "^8.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"ts-node": "^10.9.1",
"ts-patch": "^3.1.0",
"typescript": "^5.3.2",
"typia": "^5.4.5"
"typia": "^5.4.12"
},
"dependencies": {
"chalk": "^4.1.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/fetcher/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Check out the document in the [website](https://nestia.io/docs/):
- [TypedException](https://nestia.io/docs/core/TypedException/)
- Generators
- [Swagger Documents](https://nestia.io/docs/sdk/swagger/)
- [SDK Library](https://nestia.io/docs/sdk/sdk/)
- [Software Development Kit](https://nestia.io/docs/sdk/sdk/)
- [E2E Functions](https://nestia.io/docs/sdk/e2e/)
- [Mockup Simulator](https://nestia.io/docs/sdk/simulator/)
- [Swagger to NestJS](https://nestia.io/docs/migrate/)
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": "2.5.9",
"version": "2.5.10",
"description": "Fetcher library of Nestia SDK",
"main": "lib/index.js",
"typings": "lib/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Check out the document in the [website](https://nestia.io/docs/):
- [TypedException](https://nestia.io/docs/core/TypedException/)
- Generators
- [Swagger Documents](https://nestia.io/docs/sdk/swagger/)
- [SDK Library](https://nestia.io/docs/sdk/sdk/)
- [Software Development Kit](https://nestia.io/docs/sdk/sdk/)
- [E2E Functions](https://nestia.io/docs/sdk/e2e/)
- [Mockup Simulator](https://nestia.io/docs/sdk/simulator/)
- [Swagger to NestJS](https://nestia.io/docs/migrate/)
Expand Down
10 changes: 5 additions & 5 deletions packages/sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nestia/sdk",
"version": "2.5.9",
"version": "2.5.10",
"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": "^2.5.9",
"@nestia/fetcher": "^2.5.10",
"cli": "^1.0.1",
"get-function-location": "^2.0.0",
"glob": "^7.2.0",
Expand All @@ -42,15 +42,15 @@
"tsconfig-paths": "^4.1.1",
"ts-node": ">=10.6.0",
"tstl": "^2.5.13",
"typia": "^5.4.5"
"typia": "^5.4.12"
},
"peerDependencies": {
"@nestia/fetcher": ">=2.5.9",
"@nestia/fetcher": ">=2.5.10",
"@nestjs/common": ">=7.0.1",
"@nestjs/core": ">=7.0.1",
"reflect-metadata": ">=0.1.12",
"ts-node": ">=10.6.0",
"typia": ">=5.4.5 <6.0.0"
"typia": ">=5.4.12 <6.0.0"
},
"devDependencies": {
"@nestia/e2e": "^0.4.1",
Expand Down
10 changes: 5 additions & 5 deletions packages/sdk/src/generates/SwaggerGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -354,11 +354,11 @@ export namespace SwaggerGenerator {
const [explicit] = getJsDocTexts("summary");
if (explicit?.length) return explicit;

const index: number = description.indexOf(".");
if (index <= 0) return undefined;

const str: string = description.substring(0, index).trim();
return str.length && str.includes("\n") === false ? str : undefined;
const index: number = description.indexOf("\n");
const top: string = (
index === -1 ? description : description.substring(0, index)
).trim();
return top.endsWith(".") ? top.substring(0, top.length - 1) : undefined;
})();
const deprecated = route.jsDocTags.find(
(tag) => tag.name === "deprecated",
Expand Down
1 change: 1 addition & 0 deletions test/features/all/nestia.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export const NESTIA_CONFIG: INestiaConfig = {
type: "apiKey",
},
},
beautify: true,
},
};
export default NESTIA_CONFIG;
2 changes: 2 additions & 0 deletions test/features/all/src/api/functional/all/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import type { IBbsArticle } from "../../structures/IBbsArticle";
/**
* Store an article.
*
* Create an article, and returns it.
*
* @param input Content to store
* @returns Newly archived article
* @author Samchon
Expand Down
2 changes: 2 additions & 0 deletions test/features/all/src/controllers/AllController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ export class AllController {
/**
* Store an article.
*
* Create an article, and returns it.
*
* @param request Request object from express. Must be disappeared in SDK
* @param input Content to store
* @returns Newly archived article
Expand Down
Loading

0 comments on commit 20c82a1

Please sign in to comment.