Repository: nestjs/swagger
Pull request #2797 (2024-01-25 16:04:43)

fix: support type `UUID` from node's `crypto` package
## PR Checklist
Please check if your PR fulfills the following requirements:

- [x] The commit message follows our guidelines: https://github.com/nestjs/nest/blob/master/CONTRIBUTING.md
- [x] Tests for the changes have been added (for bug fixes / features)
- [ ] Docs have been added / updated (for bug fixes / features)


## PR Type
What kind of change does this PR introduce?

<!-- Please check the one that applies to this PR using "x". -->
- [x] Bugfix
- [ ] Feature
- [ ] Code style update (formatting, local variables)
- [ ] Refactoring (no functional changes, no api changes)
- [ ] Build related changes
- [ ] CI related changes
- [ ] Other... Please describe:

## What is the current behavior?
Using the `UUID` type from node's `crypto` package with the `@nestjs/swagger` plugin enabled crashes nestjs start `npm run start` with a cryptic error message.

```
Error: A circular dependency has been detected (property key: "id"). Please, make sure that each side of a bidirectional relationships are using lazy resolvers ("type: () => ClassType").
```

Example dto
```
import { UUID } from 'crypto';

export class CreateUserDto {
  name: string;

  id: UUID;
}
```

This problem goes away when the `IsUUID()` decorator from `class-validator` package is used. But considering the fact that UUID is an alias ```type UUID = `${string}-${string}-${string}-${string}-${string}`;``` the inferred type without any help should be `string`

Issue Number: N/A


## What is the new behavior?

After this change, if the plugin is enabled, and no decorator is used on a property of type `crypto.UUID` then its type gets inferred as `string` in the openapi spec.


## Does this PR introduce a breaking change?
- [ ] Yes
- [x] No

<!-- If this PR contains a breaking change, please describe the impact and migration path for existing applications below. -->


## Other information



Patch:
diff --git a/lib/plugin/utils/plugin-utils.ts b/lib/plugin/utils/plugin-utils.ts
index 138a7f85..33bfe414 100644
--- a/lib/plugin/utils/plugin-utils.ts
+++ b/lib/plugin/utils/plugin-utils.ts
@@ -115,6 +115,9 @@ export function getTypeReferenceAsString(
     if (type.aliasSymbol) {
       return { typeName: 'Object', arrayDepth };
     }
+    if (typeChecker.getApparentType(type).getSymbol().getEscapedName() === 'String') {
+      return { typeName: String.name, arrayDepth };
+    }
     return { typeName: undefined };
   } catch {
     return { typeName: undefined };
diff --git a/package-lock.json b/package-lock.json
index bba5bbb6..c532bb59 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -16,8 +16,8 @@
         "swagger-ui-dist": "5.11.0"
       },
       "devDependencies": {
-        "@commitlint/cli": "18.6.0",
-        "@commitlint/config-angular": "18.6.0",
+        "@commitlint/cli": "18.5.0",
+        "@commitlint/config-angular": "18.5.0",
         "@fastify/static": "6.12.0",
         "@nestjs/common": "10.3.1",
         "@nestjs/core": "10.3.1",
@@ -35,7 +35,7 @@
         "eslint-config-prettier": "9.1.0",
         "eslint-plugin-import": "2.29.1",
         "express": "4.18.2",
-        "husky": "9.0.6",
+        "husky": "9.0.1",
         "jest": "29.7.0",
         "lint-staged": "15.2.0",
         "openapi-types": "12.1.3",
@@ -1085,16 +1085,16 @@
       "dev": true
     },
     "node_modules/@commitlint/cli": {
-      "version": "18.6.0",
-      "resolved": "https://registry.npmjs.org/@commitlint/cli/-/cli-18.6.0.tgz",
-      "integrity": "sha512-FiH23cr9QG8VdfbmvJJZmdfHGVMCouOOAzoXZ3Cd7czGC52RbycwNt8YCI7SA69pAl+t30vh8LMaO/N+kcel6w==",
+      "version": "18.5.0",
+      "resolved": "https://registry.npmjs.org/@commitlint/cli/-/cli-18.5.0.tgz",
+      "integrity": "sha512-g/N0mJBrHcTdiccUpJknS6/ru45eIEAZyhEy9sL2ILjzK2IVNrpzlAPtxEr8bZCZLGwPBUrQ5UCIIu4uebhImw==",
       "dev": true,
       "dependencies": {
-        "@commitlint/format": "^18.6.0",
-        "@commitlint/lint": "^18.6.0",
-        "@commitlint/load": "^18.6.0",
-        "@commitlint/read": "^18.6.0",
-        "@commitlint/types": "^18.6.0",
+        "@commitlint/format": "^18.4.4",
+        "@commitlint/lint": "^18.5.0",
+        "@commitlint/load": "^18.5.0",
+        "@commitlint/read": "^18.4.4",
+        "@commitlint/types": "^18.4.4",
         "execa": "^5.0.0",
         "lodash.isfunction": "^3.0.9",
         "resolve-from": "5.0.0",
@@ -1109,9 +1109,9 @@
       }
     },
     "node_modules/@commitlint/config-angular": {
-      "version": "18.6.0",
-      "resolved": "https://registry.npmjs.org/@commitlint/config-angular/-/config-angular-18.6.0.tgz",
-      "integrity": "sha512-hZgxreQ4xCVE/59HgW3PjEUnAnByZCaUDgxWNbNEx2ivjsgPfU+bvDe+IuE2R32szz0rNoefxe2FTu/prNgcww==",
+      "version": "18.5.0",
+      "resolved": "https://registry.npmjs.org/@commitlint/config-angular/-/config-angular-18.5.0.tgz",
+      "integrity": "sha512-3oTM/fQ+YgPpgKjS6LF9XBs/4JZCYmzQ1/S8AIf+8Z/1xj09S5qyZt2+N+UKP0ZnWhkHwjD8Om6yR6VBma/JJg==",
       "dev": true,
       "dependencies": {
         "@commitlint/config-angular-type-enum": "^18.4.4"
@@ -1130,12 +1130,12 @@
       }
     },
     "node_modules/@commitlint/config-validator": {
-      "version": "18.6.0",
-      "resolved": "https://registry.npmjs.org/@commitlint/config-validator/-/config-validator-18.6.0.tgz",
-      "integrity": "sha512-Ptfa865arNozlkjxrYG3qt6wT9AlhNUHeuDyKEZiTL/l0ftncFhK/KN0t/EAMV2tec+0Mwxo0FmhbESj/bI+1g==",
+      "version": "18.5.0",
+      "resolved": "https://registry.npmjs.org/@commitlint/config-validator/-/config-validator-18.5.0.tgz",
+      "integrity": "sha512-mDAA6WQPjh9Ida8ACdInDylBQcqeUD2gBHE+dQu+B3OIHiWiSSrq4F2+wg3nDU9EzfcQSwPwYL+QbMmiW5SmLA==",
       "dev": true,
       "dependencies": {
-        "@commitlint/types": "^18.6.0",
+        "@commitlint/types": "^18.4.4",
         "ajv": "^8.11.0"
       },
       "engines": {
@@ -1165,12 +1165,12 @@
       "dev": true
     },
     "node_modules/@commitlint/ensure": {
-      "version": "18.6.0",
-      "resolved": "https://registry.npmjs.org/@commitlint/ensure/-/ensure-18.6.0.tgz",
-      "integrity": "sha512-xY07NmOBJ7JuhX3tic021PaeLepZARIQyqpAQoNQZoml1keBFfB6MbA7XlWZv0ebbarUFE4yhKxOPw+WFv7/qw==",
+      "version": "18.4.4",
+      "resolved": "https://registry.npmjs.org/@commitlint/ensure/-/ensure-18.4.4.tgz",
+      "integrity": "sha512-KjD19p6julB5WrQL+Cd8p+AePwpl1XzGAjB0jnuFMKWtji9L7ucCZUKDstGjlkBZGGzH/nvdB8K+bh5K27EVUg==",
       "dev": true,
       "dependencies": {
-        "@commitlint/types": "^18.6.0",
+        "@commitlint/types": "^18.4.4",
         "lodash.camelcase": "^4.3.0",
         "lodash.kebabcase": "^4.1.1",
         "lodash.snakecase": "^4.1.1",
@@ -1191,12 +1191,12 @@
       }
     },
     "node_modules/@commitlint/format": {
-      "version": "18.6.0",
-      "resolved": "https://registry.npmjs.org/@commitlint/format/-/format-18.6.0.tgz",
-      "integrity": "sha512-8UNWfs2slPPSQiiVpLGJTnPHv7Jkd5KYxfbNXbmLL583bjom4RrylvyrCVnmZReA8nNad7pPXq6mDH4FNVj6xg==",
+      "version": "18.4.4",
+      "resolved": "https://registry.npmjs.org/@commitlint/format/-/format-18.4.4.tgz",
+      "integrity": "sha512-2v3V5hVlv0R3pe7p66IX5F7cjeVvGM5JqITRIbBCFvGHPJ/CG74rjTkAu0RBEiIhlk3eOaLjVGq3d5falPkLBA==",
       "dev": true,
       "dependencies": {
-        "@commitlint/types": "^18.6.0",
+        "@commitlint/types": "^18.4.4",
         "chalk": "^4.1.0"
       },
       "engines": {
@@ -1204,12 +1204,12 @@
       }
     },
     "node_modules/@commitlint/is-ignored": {
-      "version": "18.6.0",
-      "resolved": "https://registry.npmjs.org/@commitlint/is-ignored/-/is-ignored-18.6.0.tgz",
-      "integrity": "sha512-Xjx/ZyyJ4FdLuz0FcOvqiqSFgiO2yYj3QN9XlvyrxqbXTxPVC7QFEXJYBVPulUSN/gR7WXH1Udw+HYYfD17xog==",
+      "version": "18.4.4",
+      "resolved": "https://registry.npmjs.org/@commitlint/is-ignored/-/is-ignored-18.4.4.tgz",
+      "integrity": "sha512-rXWes9owKBTjfTr6Od7YlflRg4N+ngkOH+dUZhk0qL/XQb26mHz0EgVgdixMVBac1OsohRwJaLmVHX+5F6vfmg==",
       "dev": true,
       "dependencies": {
-        "@commitlint/types": "^18.6.0",
+        "@commitlint/types": "^18.4.4",
         "semver": "7.5.4"
       },
       "engines": {
@@ -1217,30 +1217,30 @@
       }
     },
     "node_modules/@commitlint/lint": {
-      "version": "18.6.0",
-      "resolved": "https://registry.npmjs.org/@commitlint/lint/-/lint-18.6.0.tgz",
-      "integrity": "sha512-ycbuDWfyykPmslgiHzhz8dL6F0BJYltXLVfc+M49z0c+FNITM0v+r0Vd2+Tdtq06VTc894p2+YSmZhulY8Jn3Q==",
+      "version": "18.5.0",
+      "resolved": "https://registry.npmjs.org/@commitlint/lint/-/lint-18.5.0.tgz",
+      "integrity": "sha512-4VbfTGTZf/aDaOn+vednMQFu5EIKfERvv7j8La3etQCra0O2QMrZL28xugTroYekawpTkiWWvLswtpVfabIbgw==",
       "dev": true,
       "dependencies": {
-        "@commitlint/is-ignored": "^18.6.0",
-        "@commitlint/parse": "^18.6.0",
-        "@commitlint/rules": "^18.6.0",
-        "@commitlint/types": "^18.6.0"
+        "@commitlint/is-ignored": "^18.4.4",
+        "@commitlint/parse": "^18.4.4",
+        "@commitlint/rules": "^18.4.4",
+        "@commitlint/types": "^18.4.4"
       },
       "engines": {
         "node": ">=v18"
       }
     },
     "node_modules/@commitlint/load": {
-      "version": "18.6.0",
-      "resolved": "https://registry.npmjs.org/@commitlint/load/-/load-18.6.0.tgz",
-      "integrity": "sha512-RRssj7TmzT0bowoEKlgwg8uQ7ORXWkw7lYLsZZBMi9aInsJuGNLNWcMxJxRZbwxG3jkCidGUg85WmqJvRjsaDA==",
+      "version": "18.5.0",
+      "resolved": "https://registry.npmjs.org/@commitlint/load/-/load-18.5.0.tgz",
+      "integrity": "sha512-vpyGgk7rzbFsU01NVwPNC/WetHFP0EwSYnQ1R833SJFHkEo+cWvqoVlw/VoZwBMoI6sF5/lwEdKzFDr1DHJ6+A==",
       "dev": true,
       "dependencies": {
-        "@commitlint/config-validator": "^18.6.0",
+        "@commitlint/config-validator": "^18.5.0",
         "@commitlint/execute-rule": "^18.4.4",
-        "@commitlint/resolve-extends": "^18.6.0",
-        "@commitlint/types": "^18.6.0",
+        "@commitlint/resolve-extends": "^18.5.0",
+        "@commitlint/types": "^18.4.4",
         "chalk": "^4.1.0",
         "cosmiconfig": "^8.3.6",
         "cosmiconfig-typescript-loader": "^5.0.0",
@@ -1263,12 +1263,12 @@
       }
     },
     "node_modules/@commitlint/parse": {
-      "version": "18.6.0",
-      "resolved": "https://registry.npmjs.org/@commitlint/parse/-/parse-18.6.0.tgz",
-      "integrity": "sha512-Y/G++GJpATFw54O0jikc/h2ibyGHgghtPnwsOk3O/aU092ydJ5XEHYcd7xGNQYuLweLzQis2uEwRNk9AVIPbQQ==",
+      "version": "18.4.4",
+      "resolved": "https://registry.npmjs.org/@commitlint/parse/-/parse-18.4.4.tgz",
+      "integrity": "sha512-99G7dyn/OoyNWXJni0Ki0K3aJd01pEb/Im/Id6y4X7PN+kGOahjz2z/cXYYHn7xDdooqFVdiVrVLeChfgpWZ2g==",
       "dev": true,
       "dependencies": {
-        "@commitlint/types": "^18.6.0",
+        "@commitlint/types": "^18.4.4",
         "conventional-changelog-angular": "^7.0.0",
         "conventional-commits-parser": "^5.0.0"
       },
@@ -1277,13 +1277,13 @@
       }
     },
     "node_modules/@commitlint/read": {
-      "version": "18.6.0",
-      "resolved": "https://registry.npmjs.org/@commitlint/read/-/read-18.6.0.tgz",
-      "integrity": "sha512-w39ji8VfWhPKRquPhRHB3Yd8XIHwaNHgOh28YI1QEmZ59qVpuVUQo6h/NsVb+uoC6LbXZiofTZv2iFR084jKEA==",
+      "version": "18.4.4",
+      "resolved": "https://registry.npmjs.org/@commitlint/read/-/read-18.4.4.tgz",
+      "integrity": "sha512-r58JbWky4gAFPea/CZmvlqP9Ehbs+8gSEUqhIJOojKzTc3xlxFnZUDVPcEnnaqzQEEoV6C69VW7xuzdcBlu/FQ==",
       "dev": true,
       "dependencies": {
         "@commitlint/top-level": "^18.4.4",
-        "@commitlint/types": "^18.6.0",
+        "@commitlint/types": "^18.4.4",
         "git-raw-commits": "^2.0.11",
         "minimist": "^1.2.6"
       },
@@ -1292,13 +1292,13 @@
       }
     },
     "node_modules/@commitlint/resolve-extends": {
-      "version": "18.6.0",
-      "resolved": "https://registry.npmjs.org/@commitlint/resolve-extends/-/resolve-extends-18.6.0.tgz",
-      "integrity": "sha512-k2Xp+Fxeggki2i90vGrbiLDMefPius3zGSTFFlRAPKce/SWLbZtI+uqE9Mne23mHO5lmcSV8z5m6ziiJwGpOcg==",
+      "version": "18.5.0",
+      "resolved": "https://registry.npmjs.org/@commitlint/resolve-extends/-/resolve-extends-18.5.0.tgz",
+      "integrity": "sha512-OxCYOMnlkOEEIkwTaRiFjHyuWBq962WBZQVHfMHej8tr3d+SfjznvqZhPmW8/SuqtfmGEiJPGWUNOxgwH+O0MA==",
       "dev": true,
       "dependencies": {
-        "@commitlint/config-validator": "^18.6.0",
-        "@commitlint/types": "^18.6.0",
+        "@commitlint/config-validator": "^18.5.0",
+        "@commitlint/types": "^18.4.4",
         "import-fresh": "^3.0.0",
         "lodash.mergewith": "^4.6.2",
         "resolve-from": "^5.0.0",
@@ -1309,15 +1309,15 @@
       }
     },
     "node_modules/@commitlint/rules": {
-      "version": "18.6.0",
-      "resolved": "https://registry.npmjs.org/@commitlint/rules/-/rules-18.6.0.tgz",
-      "integrity": "sha512-pTalvCEvuCWrBWZA/YqO/3B3nZnY3Ncc+TmQsRajBdC1tkQIm5Iovdo4Ec7f2Dw1tVvpYMUUNAgcWqsY0WckWg==",
+      "version": "18.4.4",
+      "resolved": "https://registry.npmjs.org/@commitlint/rules/-/rules-18.4.4.tgz",
+      "integrity": "sha512-6Uzlsnl/GljEI+80NWjf4ThOfR8NIsbm18IfXYuCEchlwMHSxiuYG4rHSK5DNmG/+MIo8eR5VdQ0gQyt7kWzAA==",
       "dev": true,
       "dependencies": {
-        "@commitlint/ensure": "^18.6.0",
+        "@commitlint/ensure": "^18.4.4",
         "@commitlint/message": "^18.4.4",
         "@commitlint/to-lines": "^18.4.4",
-        "@commitlint/types": "^18.6.0",
+        "@commitlint/types": "^18.4.4",
         "execa": "^5.0.0"
       },
       "engines": {
@@ -1392,9 +1392,9 @@
       }
     },
     "node_modules/@commitlint/types": {
-      "version": "18.6.0",
-      "resolved": "https://registry.npmjs.org/@commitlint/types/-/types-18.6.0.tgz",
-      "integrity": "sha512-oavoKLML/eJa2rJeyYSbyGAYzTxQ6voG5oeX3OrxpfrkRWhJfm4ACnhoRf5tgiybx2MZ+EVFqC1Lw3W8/uwpZA==",
+      "version": "18.4.4",
+      "resolved": "https://registry.npmjs.org/@commitlint/types/-/types-18.4.4.tgz",
+      "integrity": "sha512-/FykLtodD8gKs3+VNkAUwofu4LBHankclj+I8fB2jTRvG6PV7k/OUt4P+VbM7ip853qS4F0g7Z6hLNa6JeMcAQ==",
       "dev": true,
       "dependencies": {
         "chalk": "^4.1.0"
@@ -6805,9 +6805,9 @@
       }
     },
     "node_modules/husky": {
-      "version": "9.0.6",
-      "resolved": "https://registry.npmjs.org/husky/-/husky-9.0.6.tgz",
-      "integrity": "sha512-EEuw/rfTiMjOfuL7pGO/i9otg1u36TXxqjIA6D9qxVjd/UXoDOsLor/BSFf5hTK50shwzCU3aVVwdXDp/lp7RA==",
+      "version": "9.0.1",
+      "resolved": "https://registry.npmjs.org/husky/-/husky-9.0.1.tgz",
+      "integrity": "sha512-rXCT8yF2v3awSG03AG6IgICDhJ+m8o3jL1ROwsT4nQZ6urEyKSj0IWFDIh5YC2zgZeAxWksNMbN6rYY4BE1Zrw==",
       "dev": true,
       "bin": {
         "husky": "bin.js"
@@ -13827,16 +13827,16 @@
       "dev": true
     },
     "@commitlint/cli": {
-      "version": "18.6.0",
-      "resolved": "https://registry.npmjs.org/@commitlint/cli/-/cli-18.6.0.tgz",
-      "integrity": "sha512-FiH23cr9QG8VdfbmvJJZmdfHGVMCouOOAzoXZ3Cd7czGC52RbycwNt8YCI7SA69pAl+t30vh8LMaO/N+kcel6w==",
+      "version": "18.5.0",
+      "resolved": "https://registry.npmjs.org/@commitlint/cli/-/cli-18.5.0.tgz",
+      "integrity": "sha512-g/N0mJBrHcTdiccUpJknS6/ru45eIEAZyhEy9sL2ILjzK2IVNrpzlAPtxEr8bZCZLGwPBUrQ5UCIIu4uebhImw==",
       "dev": true,
       "requires": {
-        "@commitlint/format": "^18.6.0",
-        "@commitlint/lint": "^18.6.0",
-        "@commitlint/load": "^18.6.0",
-        "@commitlint/read": "^18.6.0",
-        "@commitlint/types": "^18.6.0",
+        "@commitlint/format": "^18.4.4",
+        "@commitlint/lint": "^18.5.0",
+        "@commitlint/load": "^18.5.0",
+        "@commitlint/read": "^18.4.4",
+        "@commitlint/types": "^18.4.4",
         "execa": "^5.0.0",
         "lodash.isfunction": "^3.0.9",
         "resolve-from": "5.0.0",
@@ -13845,9 +13845,9 @@
       }
     },
     "@commitlint/config-angular": {
-      "version": "18.6.0",
-      "resolved": "https://registry.npmjs.org/@commitlint/config-angular/-/config-angular-18.6.0.tgz",
-      "integrity": "sha512-hZgxreQ4xCVE/59HgW3PjEUnAnByZCaUDgxWNbNEx2ivjsgPfU+bvDe+IuE2R32szz0rNoefxe2FTu/prNgcww==",
+      "version": "18.5.0",
+      "resolved": "https://registry.npmjs.org/@commitlint/config-angular/-/config-angular-18.5.0.tgz",
+      "integrity": "sha512-3oTM/fQ+YgPpgKjS6LF9XBs/4JZCYmzQ1/S8AIf+8Z/1xj09S5qyZt2+N+UKP0ZnWhkHwjD8Om6yR6VBma/JJg==",
       "dev": true,
       "requires": {
         "@commitlint/config-angular-type-enum": "^18.4.4"
@@ -13860,12 +13860,12 @@
       "dev": true
     },
     "@commitlint/config-validator": {
-      "version": "18.6.0",
-      "resolved": "https://registry.npmjs.org/@commitlint/config-validator/-/config-validator-18.6.0.tgz",
-      "integrity": "sha512-Ptfa865arNozlkjxrYG3qt6wT9AlhNUHeuDyKEZiTL/l0ftncFhK/KN0t/EAMV2tec+0Mwxo0FmhbESj/bI+1g==",
+      "version": "18.5.0",
+      "resolved": "https://registry.npmjs.org/@commitlint/config-validator/-/config-validator-18.5.0.tgz",
+      "integrity": "sha512-mDAA6WQPjh9Ida8ACdInDylBQcqeUD2gBHE+dQu+B3OIHiWiSSrq4F2+wg3nDU9EzfcQSwPwYL+QbMmiW5SmLA==",
       "dev": true,
       "requires": {
-        "@commitlint/types": "^18.6.0",
+        "@commitlint/types": "^18.4.4",
         "ajv": "^8.11.0"
       },
       "dependencies": {
@@ -13890,12 +13890,12 @@
       }
     },
     "@commitlint/ensure": {
-      "version": "18.6.0",
-      "resolved": "https://registry.npmjs.org/@commitlint/ensure/-/ensure-18.6.0.tgz",
-      "integrity": "sha512-xY07NmOBJ7JuhX3tic021PaeLepZARIQyqpAQoNQZoml1keBFfB6MbA7XlWZv0ebbarUFE4yhKxOPw+WFv7/qw==",
+      "version": "18.4.4",
+      "resolved": "https://registry.npmjs.org/@commitlint/ensure/-/ensure-18.4.4.tgz",
+      "integrity": "sha512-KjD19p6julB5WrQL+Cd8p+AePwpl1XzGAjB0jnuFMKWtji9L7ucCZUKDstGjlkBZGGzH/nvdB8K+bh5K27EVUg==",
       "dev": true,
       "requires": {
-        "@commitlint/types": "^18.6.0",
+        "@commitlint/types": "^18.4.4",
         "lodash.camelcase": "^4.3.0",
         "lodash.kebabcase": "^4.1.1",
         "lodash.snakecase": "^4.1.1",
@@ -13910,47 +13910,47 @@
       "dev": true
     },
     "@commitlint/format": {
-      "version": "18.6.0",
-      "resolved": "https://registry.npmjs.org/@commitlint/format/-/format-18.6.0.tgz",
-      "integrity": "sha512-8UNWfs2slPPSQiiVpLGJTnPHv7Jkd5KYxfbNXbmLL583bjom4RrylvyrCVnmZReA8nNad7pPXq6mDH4FNVj6xg==",
+      "version": "18.4.4",
+      "resolved": "https://registry.npmjs.org/@commitlint/format/-/format-18.4.4.tgz",
+      "integrity": "sha512-2v3V5hVlv0R3pe7p66IX5F7cjeVvGM5JqITRIbBCFvGHPJ/CG74rjTkAu0RBEiIhlk3eOaLjVGq3d5falPkLBA==",
       "dev": true,
       "requires": {
-        "@commitlint/types": "^18.6.0",
+        "@commitlint/types": "^18.4.4",
         "chalk": "^4.1.0"
       }
     },
     "@commitlint/is-ignored": {
-      "version": "18.6.0",
-      "resolved": "https://registry.npmjs.org/@commitlint/is-ignored/-/is-ignored-18.6.0.tgz",
-      "integrity": "sha512-Xjx/ZyyJ4FdLuz0FcOvqiqSFgiO2yYj3QN9XlvyrxqbXTxPVC7QFEXJYBVPulUSN/gR7WXH1Udw+HYYfD17xog==",
+      "version": "18.4.4",
+      "resolved": "https://registry.npmjs.org/@commitlint/is-ignored/-/is-ignored-18.4.4.tgz",
+      "integrity": "sha512-rXWes9owKBTjfTr6Od7YlflRg4N+ngkOH+dUZhk0qL/XQb26mHz0EgVgdixMVBac1OsohRwJaLmVHX+5F6vfmg==",
       "dev": true,
       "requires": {
-        "@commitlint/types": "^18.6.0",
+        "@commitlint/types": "^18.4.4",
         "semver": "7.5.4"
       }
     },
     "@commitlint/lint": {
-      "version": "18.6.0",
-      "resolved": "https://registry.npmjs.org/@commitlint/lint/-/lint-18.6.0.tgz",
-      "integrity": "sha512-ycbuDWfyykPmslgiHzhz8dL6F0BJYltXLVfc+M49z0c+FNITM0v+r0Vd2+Tdtq06VTc894p2+YSmZhulY8Jn3Q==",
+      "version": "18.5.0",
+      "resolved": "https://registry.npmjs.org/@commitlint/lint/-/lint-18.5.0.tgz",
+      "integrity": "sha512-4VbfTGTZf/aDaOn+vednMQFu5EIKfERvv7j8La3etQCra0O2QMrZL28xugTroYekawpTkiWWvLswtpVfabIbgw==",
       "dev": true,
       "requires": {
-        "@commitlint/is-ignored": "^18.6.0",
-        "@commitlint/parse": "^18.6.0",
-        "@commitlint/rules": "^18.6.0",
-        "@commitlint/types": "^18.6.0"
+        "@commitlint/is-ignored": "^18.4.4",
+        "@commitlint/parse": "^18.4.4",
+        "@commitlint/rules": "^18.4.4",
+        "@commitlint/types": "^18.4.4"
       }
     },
     "@commitlint/load": {
-      "version": "18.6.0",
-      "resolved": "https://registry.npmjs.org/@commitlint/load/-/load-18.6.0.tgz",
-      "integrity": "sha512-RRssj7TmzT0bowoEKlgwg8uQ7ORXWkw7lYLsZZBMi9aInsJuGNLNWcMxJxRZbwxG3jkCidGUg85WmqJvRjsaDA==",
+      "version": "18.5.0",
+      "resolved": "https://registry.npmjs.org/@commitlint/load/-/load-18.5.0.tgz",
+      "integrity": "sha512-vpyGgk7rzbFsU01NVwPNC/WetHFP0EwSYnQ1R833SJFHkEo+cWvqoVlw/VoZwBMoI6sF5/lwEdKzFDr1DHJ6+A==",
       "dev": true,
       "requires": {
-        "@commitlint/config-validator": "^18.6.0",
+        "@commitlint/config-validator": "^18.5.0",
         "@commitlint/execute-rule": "^18.4.4",
-        "@commitlint/resolve-extends": "^18.6.0",
-        "@commitlint/types": "^18.6.0",
+        "@commitlint/resolve-extends": "^18.5.0",
+        "@commitlint/types": "^18.4.4",
         "chalk": "^4.1.0",
         "cosmiconfig": "^8.3.6",
         "cosmiconfig-typescript-loader": "^5.0.0",
@@ -13967,36 +13967,36 @@
       "dev": true
     },
     "@commitlint/parse": {
-      "version": "18.6.0",
-      "resolved": "https://registry.npmjs.org/@commitlint/parse/-/parse-18.6.0.tgz",
-      "integrity": "sha512-Y/G++GJpATFw54O0jikc/h2ibyGHgghtPnwsOk3O/aU092ydJ5XEHYcd7xGNQYuLweLzQis2uEwRNk9AVIPbQQ==",
+      "version": "18.4.4",
+      "resolved": "https://registry.npmjs.org/@commitlint/parse/-/parse-18.4.4.tgz",
+      "integrity": "sha512-99G7dyn/OoyNWXJni0Ki0K3aJd01pEb/Im/Id6y4X7PN+kGOahjz2z/cXYYHn7xDdooqFVdiVrVLeChfgpWZ2g==",
       "dev": true,
       "requires": {
-        "@commitlint/types": "^18.6.0",
+        "@commitlint/types": "^18.4.4",
         "conventional-changelog-angular": "^7.0.0",
         "conventional-commits-parser": "^5.0.0"
       }
     },
     "@commitlint/read": {
-      "version": "18.6.0",
-      "resolved": "https://registry.npmjs.org/@commitlint/read/-/read-18.6.0.tgz",
-      "integrity": "sha512-w39ji8VfWhPKRquPhRHB3Yd8XIHwaNHgOh28YI1QEmZ59qVpuVUQo6h/NsVb+uoC6LbXZiofTZv2iFR084jKEA==",
+      "version": "18.4.4",
+      "resolved": "https://registry.npmjs.org/@commitlint/read/-/read-18.4.4.tgz",
+      "integrity": "sha512-r58JbWky4gAFPea/CZmvlqP9Ehbs+8gSEUqhIJOojKzTc3xlxFnZUDVPcEnnaqzQEEoV6C69VW7xuzdcBlu/FQ==",
       "dev": true,
       "requires": {
         "@commitlint/top-level": "^18.4.4",
-        "@commitlint/types": "^18.6.0",
+        "@commitlint/types": "^18.4.4",
         "git-raw-commits": "^2.0.11",
         "minimist": "^1.2.6"
       }
     },
     "@commitlint/resolve-extends": {
-      "version": "18.6.0",
-      "resolved": "https://registry.npmjs.org/@commitlint/resolve-extends/-/resolve-extends-18.6.0.tgz",
-      "integrity": "sha512-k2Xp+Fxeggki2i90vGrbiLDMefPius3zGSTFFlRAPKce/SWLbZtI+uqE9Mne23mHO5lmcSV8z5m6ziiJwGpOcg==",
+      "version": "18.5.0",
+      "resolved": "https://registry.npmjs.org/@commitlint/resolve-extends/-/resolve-extends-18.5.0.tgz",
+      "integrity": "sha512-OxCYOMnlkOEEIkwTaRiFjHyuWBq962WBZQVHfMHej8tr3d+SfjznvqZhPmW8/SuqtfmGEiJPGWUNOxgwH+O0MA==",
       "dev": true,
       "requires": {
-        "@commitlint/config-validator": "^18.6.0",
-        "@commitlint/types": "^18.6.0",
+        "@commitlint/config-validator": "^18.5.0",
+        "@commitlint/types": "^18.4.4",
         "import-fresh": "^3.0.0",
         "lodash.mergewith": "^4.6.2",
         "resolve-from": "^5.0.0",
@@ -14004,15 +14004,15 @@
       }
     },
     "@commitlint/rules": {
-      "version": "18.6.0",
-      "resolved": "https://registry.npmjs.org/@commitlint/rules/-/rules-18.6.0.tgz",
-      "integrity": "sha512-pTalvCEvuCWrBWZA/YqO/3B3nZnY3Ncc+TmQsRajBdC1tkQIm5Iovdo4Ec7f2Dw1tVvpYMUUNAgcWqsY0WckWg==",
+      "version": "18.4.4",
+      "resolved": "https://registry.npmjs.org/@commitlint/rules/-/rules-18.4.4.tgz",
+      "integrity": "sha512-6Uzlsnl/GljEI+80NWjf4ThOfR8NIsbm18IfXYuCEchlwMHSxiuYG4rHSK5DNmG/+MIo8eR5VdQ0gQyt7kWzAA==",
       "dev": true,
       "requires": {
-        "@commitlint/ensure": "^18.6.0",
+        "@commitlint/ensure": "^18.4.4",
         "@commitlint/message": "^18.4.4",
         "@commitlint/to-lines": "^18.4.4",
-        "@commitlint/types": "^18.6.0",
+        "@commitlint/types": "^18.4.4",
         "execa": "^5.0.0"
       }
     },
@@ -14062,9 +14062,9 @@
       }
     },
     "@commitlint/types": {
-      "version": "18.6.0",
-      "resolved": "https://registry.npmjs.org/@commitlint/types/-/types-18.6.0.tgz",
-      "integrity": "sha512-oavoKLML/eJa2rJeyYSbyGAYzTxQ6voG5oeX3OrxpfrkRWhJfm4ACnhoRf5tgiybx2MZ+EVFqC1Lw3W8/uwpZA==",
+      "version": "18.4.4",
+      "resolved": "https://registry.npmjs.org/@commitlint/types/-/types-18.4.4.tgz",
+      "integrity": "sha512-/FykLtodD8gKs3+VNkAUwofu4LBHankclj+I8fB2jTRvG6PV7k/OUt4P+VbM7ip853qS4F0g7Z6hLNa6JeMcAQ==",
       "dev": true,
       "requires": {
         "chalk": "^4.1.0"
@@ -18137,9 +18137,9 @@
       "dev": true
     },
     "husky": {
-      "version": "9.0.6",
-      "resolved": "https://registry.npmjs.org/husky/-/husky-9.0.6.tgz",
-      "integrity": "sha512-EEuw/rfTiMjOfuL7pGO/i9otg1u36TXxqjIA6D9qxVjd/UXoDOsLor/BSFf5hTK50shwzCU3aVVwdXDp/lp7RA==",
+      "version": "9.0.1",
+      "resolved": "https://registry.npmjs.org/husky/-/husky-9.0.1.tgz",
+      "integrity": "sha512-rXCT8yF2v3awSG03AG6IgICDhJ+m8o3jL1ROwsT4nQZ6urEyKSj0IWFDIh5YC2zgZeAxWksNMbN6rYY4BE1Zrw==",
       "dev": true
     },
     "iconv-lite": {
diff --git a/package.json b/package.json
index a73fc877..d2da60fc 100644
--- a/package.json
+++ b/package.json
@@ -31,8 +31,8 @@
     "swagger-ui-dist": "5.11.0"
   },
   "devDependencies": {
-    "@commitlint/cli": "18.6.0",
-    "@commitlint/config-angular": "18.6.0",
+    "@commitlint/cli": "18.5.0",
+    "@commitlint/config-angular": "18.5.0",
     "@fastify/static": "6.12.0",
     "@nestjs/common": "10.3.1",
     "@nestjs/core": "10.3.1",
@@ -50,7 +50,7 @@
     "eslint-config-prettier": "9.1.0",
     "eslint-plugin-import": "2.29.1",
     "express": "4.18.2",
-    "husky": "9.0.6",
+    "husky": "9.0.1",
     "jest": "29.7.0",
     "lint-staged": "15.2.0",
     "openapi-types": "12.1.3",


Test patch:
diff --git a/test/plugin/fixtures/create-cat.dto.ts b/test/plugin/fixtures/create-cat.dto.ts
index 60524665..14dff7bb 100644
--- a/test/plugin/fixtures/create-cat.dto.ts
+++ b/test/plugin/fixtures/create-cat.dto.ts
@@ -1,4 +1,5 @@
 export const createCatDtoText = `
+import { UUID } from 'crypto';
 import { IsInt, IsString, IsPositive, IsNegative, Length, Matches, IsIn } from 'class-validator';
 
 enum Status {
@@ -50,7 +51,7 @@ export class CreateCatDto {
   nodes: Node[];
   optionalBoolean?: boolean;
   date: Date;
-  
+
   twoDimensionPrimitives: string[][];
   twoDimensionNodes: OtherNode[][];
 
@@ -58,6 +59,10 @@ export class CreateCatDto {
   hidden: number;
 
   static staticProperty: string;
+
+  cryptoUUIDProperty: UUID;
+
+  arrayOfUUIDs: UUID[];
 }
 `;
 
@@ -85,7 +90,7 @@ export class CreateCatDto {
         this.status = Status.ENABLED;
     }
     static _OPENAPI_METADATA_FACTORY() {
-        return { isIn: { required: true, type: () => String, enum: ['a', 'b'] }, pattern: { required: true, type: () => String, pattern: "/^[+]?abc$/" }, name: { required: true, type: () => String }, age: { required: true, type: () => Number, default: 3, minimum: 0, maximum: 10 }, positive: { required: true, type: () => Number, default: 5, minimum: 1 }, negative: { required: true, type: () => Number, default: -1, maximum: -1 }, lengthMin: { required: true, type: () => String, minLength: 2 }, lengthMinMax: { required: true, type: () => String, minLength: 3, maxLength: 5 }, tags: { required: true, type: () => [String] }, status: { required: true, default: Status.ENABLED, enum: Status }, status2: { required: false, enum: Status }, statusArr: { required: false, enum: Status, isArray: true }, oneValueEnum: { required: false, enum: OneValueEnum }, oneValueEnumArr: { required: false, enum: OneValueEnum }, breed: { required: false, type: () => String, title: "this is breed im comment" }, nodes: { required: true, type: () => [Object] }, optionalBoolean: { required: false, type: () => Boolean }, date: { required: true, type: () => Date }, twoDimensionPrimitives: { required: true, type: () => [[String]] }, twoDimensionNodes: { required: true, type: () => [[OtherNode]] } };
+        return { isIn: { required: true, type: () => String, enum: ['a', 'b'] }, pattern: { required: true, type: () => String, pattern: "/^[+]?abc$/" }, name: { required: true, type: () => String }, age: { required: true, type: () => Number, default: 3, minimum: 0, maximum: 10 }, positive: { required: true, type: () => Number, default: 5, minimum: 1 }, negative: { required: true, type: () => Number, default: -1, maximum: -1 }, lengthMin: { required: true, type: () => String, minLength: 2 }, lengthMinMax: { required: true, type: () => String, minLength: 3, maxLength: 5 }, tags: { required: true, type: () => [String] }, status: { required: true, default: Status.ENABLED, enum: Status }, status2: { required: false, enum: Status }, statusArr: { required: false, enum: Status, isArray: true }, oneValueEnum: { required: false, enum: OneValueEnum }, oneValueEnumArr: { required: false, enum: OneValueEnum }, breed: { required: false, type: () => String, title: "this is breed im comment" }, nodes: { required: true, type: () => [Object] }, optionalBoolean: { required: false, type: () => Boolean }, date: { required: true, type: () => Date }, twoDimensionPrimitives: { required: true, type: () => [[String]] }, twoDimensionNodes: { required: true, type: () => [[OtherNode]] }, cryptoUUIDProperty: { required: true, type: () => String }, arrayOfUUIDs: { required: true, type: () => [String] } };
     }
 }
 __decorate([