can we add a confg like generateDTO for swagger to add api property
generator zod {
provider = "nestjs-zod-prisma"
output = "./src/zod" // (default) the directory where generated zod schemas will be saved
relationModel = true // (default) Create and export both plain and related models.
// relationModel = "default" // Do not export model without relations.
// relationModel = false // Do not generate related model
generateDto = true // (default) Generate DTOs for NestJS
generateSwaggerApiProperty = true // (default) Genrate ApiPrpoertyDecorator on DTO's
...
From schema.prisma
model User {
id String @id /// @z.string()
email String @unique /// @z.string().email() @ApiProperty({ example: 'test@email.com', description: 'User email' })
full_name String @unique /// @z.string().max(50, { message: "Fullname should be less than 50 characters " }) @ApiProperty({ example: 'Jean Doe', description: 'Users full name' })
password String @unique /// @z.password().atLeastOne('digit').atLeastOne('lowercase').atLeastOne('uppercase').min(8).max(100) @ApiProperty({ description: 'User password' })
}
Also desire this =D
There are some interesting behaviors from this other generator that could be included, like @DtoReadOnly and creations of Create / Update dtos
can we add a confg like generateDTO for swagger to add api property
From
schema.prisma
To Generate
example