From 3b8ead55a4e08633a779a1f6dda9c7354bed2ceb Mon Sep 17 00:00:00 2001 From: Fozail Akram Date: Thu, 23 Jan 2025 00:37:17 +0530 Subject: [PATCH] fix: incorrect IsUuid class-validator decorator not generating pattern uuid --- lib/services/decorators-properties.ts | 2 +- test/plugin/fixtures/create-cat.dto.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/services/decorators-properties.ts b/lib/services/decorators-properties.ts index d9c938865..87b84a646 100644 --- a/lib/services/decorators-properties.ts +++ b/lib/services/decorators-properties.ts @@ -90,7 +90,7 @@ export const decoratorsProperties = [ }, { mappingType: decoratorsPropertiesMappingType.INDIRECT_VALUE, - decorator: 'IsUuid', + decorator: 'IsUUID', property: 'format', value: 'uuid' }, diff --git a/test/plugin/fixtures/create-cat.dto.ts b/test/plugin/fixtures/create-cat.dto.ts index ed0ce700d..cb6451408 100644 --- a/test/plugin/fixtures/create-cat.dto.ts +++ b/test/plugin/fixtures/create-cat.dto.ts @@ -56,7 +56,7 @@ export class CreateCatDto { response: Record; @IsUrl() githubAccount: string; - @IsUuid() + @IsUUID() transactionId: string; @IsMobilePhone() phoneNumber: string; @@ -177,7 +177,7 @@ __decorate([ IsUrl() ], CreateCatDto.prototype, "githubAccount", void 0); __decorate([ - IsUuid() + IsUUID() ], CreateCatDto.prototype, "transactionId", void 0); __decorate([ IsMobilePhone()