DEV Community

Integrate Zod and Open API into Nest.js Prisma project

ikeda1729 on October 04, 2023

In this article, I will show how to use Zod and Open API (Swagger) in a Nest.js, Prisma project. I made a github repo for this example. https://git...
Collapse
 
laptiev profile image
Dmytro

Why don't you wanna use class-validator?

Collapse
 
ikeda1729 profile image
ikeda1729

class-validator is OK too, of course.
I feel like it's redundant to do write @ApiProperty on each field.

Collapse
 
ikeda1729 profile image
ikeda1729

Additionally, it is convenient to generate zod shcemas from a prisma schema.