prisma-generator-nestjs-dto
prisma-generator-nestjs-dto copied to clipboard
[Feature] Add Validation Annotations
Problem
I cannot add custom validation class annotations to the generated typescript classes from the prisma.schema
Feature Request
If there is a model that looks like this:
model Organization {
id String @id @default(cuid())
name String @unique
email String
}
It would be nice to have the ability to add annotations as follows:
model Organization {
id String @id @default(cuid())
/// @IsNotEmpty()
name String @unique
/// @IsEmail()
email String
}
that would create a class like this:
export class CreateOrganizationDto {
@IsNotEmpty()
name: string;
@IsEmail()
email: string;
}
Yea, the lack of this feature is going to prevent me from being able to use this library.
A few months ago, I forked this repo to add some additional features according to our project needs. One of them was to include those class validation decorators. You may want to have a look and try here: https://www.npmjs.com/package/@brakebein/prisma-generator-nestjs-dto
@Brakebein nice repo, i will try this and give start thank you