-
-
Notifications
You must be signed in to change notification settings - Fork 163
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix #842 - exact description comment tracing.
When object alias type comes, `typia` had failed to catch its description comment and comment tags. This PR fixes such long time bug. As the description comment is not important feature in `typia`, nobody had identified it until @jakubpavlicko22 says.
- Loading branch information
Showing
13 changed files
with
48 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,31 @@ | ||
import typia, { IJsonApplication, IJsonComponents } from "typia"; | ||
import typia from "typia"; | ||
|
||
interface IQuery { | ||
nonRequired: string | undefined; | ||
/** | ||
* Some description. | ||
* | ||
* @title something | ||
*/ | ||
interface Interface { | ||
value: number; | ||
} | ||
|
||
const app: IJsonApplication = typia.json.application<[Partial<IQuery>]>(); | ||
const query: IJsonComponents.IObject = app.components.schemas | ||
?.PartialIQuery as IJsonComponents.IObject; | ||
/** | ||
* Some description. | ||
* | ||
* @title something | ||
*/ | ||
interface Type { | ||
value: number; | ||
} | ||
|
||
console.log( | ||
Object.entries(query.properties).map(([key, value]) => [ | ||
key, | ||
value["x-typia-required"], | ||
value["x-typia-optional"], | ||
]), | ||
); | ||
const app = typia.json.application<[Interface, Type]>(); | ||
console.log({ | ||
interface: { | ||
description: app.components.schemas?.Interface?.description, | ||
tags: app.components.schemas?.Interface?.["x-typia-jsDocTags"], | ||
}, | ||
type: { | ||
description: app.components.schemas?.Type?.description, | ||
tags: app.components.schemas?.Type?.["x-typia-jsDocTags"], | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters