Skip to content

Commit

Permalink
Merge pull request #911 from samchon/features/escaper
Browse files Browse the repository at this point in the history
Close samchon/typia#1062: adapt `UniqueItems` tag on `@nestia/migrate`.
  • Loading branch information
samchon authored Jun 3, 2024
2 parents 08bcb2b + f7df862 commit 2acb7e6
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 deletions.
6 changes: 3 additions & 3 deletions packages/migrate/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nestia/migrate",
"version": "0.13.13",
"version": "0.13.14",
"description": "Migration program from swagger to NestJS",
"main": "lib/index.js",
"typings": "lib/index.d.ts",
Expand Down Expand Up @@ -60,13 +60,13 @@
"typescript-transform-paths": "^3.4.6"
},
"dependencies": {
"@samchon/openapi": "^0.1.21",
"@samchon/openapi": "^0.1.22",
"commander": "10.0.0",
"inquirer": "8.2.5",
"prettier": "^3.2.5",
"tstl": "^3.0.0",
"typescript": "^5.4.5",
"typia": "^6.0.3"
"typia": "^6.0.5"
},
"files": [
"lib",
Expand Down
9 changes: 5 additions & 4 deletions packages/migrate/src/programmers/MigrateImportProgrammer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,16 @@ export class MigrateImportProgrammer {
);
}

public tag(type: string, arg: any): ts.TypeReferenceNode {
public tag(type: string, arg?: any): ts.TypeReferenceNode {
const instance: string = this.external({
type: "instance",
library: "typia",
name: "tags",
});
return ts.factory.createTypeReferenceNode(`${instance}.${type}`, [
TypeLiteralFactory.generate(arg),
]);
return ts.factory.createTypeReferenceNode(
`${instance}.${type}`,
arg === undefined ? [] : [TypeLiteralFactory.generate(arg)],
);
}

public toStatements(
Expand Down
2 changes: 2 additions & 0 deletions packages/migrate/src/programmers/MigrateSchemaProgrammer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,8 @@ export namespace MigrateSchemaProgrammer {
intersection.push(importer.tag("MinItems", schema.minItems));
if (schema.maxItems !== undefined)
intersection.push(importer.tag("MaxItems", schema.maxItems));
if (schema.uniqueItems === true)
intersection.push(importer.tag("UniqueItems"));
writePlugin({
importer,
regular: typia.misc.literals<keyof OpenApi.IJsonSchema.IArray>(),
Expand Down
6 changes: 3 additions & 3 deletions website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
"@mui/icons-material": "5.15.6",
"@mui/material": "5.15.6",
"@mui/system": "5.15.6",
"@nestia/migrate": "^0.13.10",
"@samchon/openapi": "^0.1.21",
"@nestia/migrate": "^0.13.13",
"@samchon/openapi": "^0.1.22",
"@stackblitz/sdk": "^1.9.0",
"js-yaml": "^4.1.0",
"next": "14.1.1",
Expand All @@ -34,7 +34,7 @@
"react": "18.2.0",
"react-dom": "18.2.0",
"react-mui-fileuploader": "^0.5.2",
"typia": "^6.0.3"
"typia": "^6.0.5"
},
"devDependencies": {
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
Expand Down

0 comments on commit 2acb7e6

Please sign in to comment.