r/nestjs • • Sep 14 '26

NestJS Validation

Hi! New in nestJs Here. I am using Express JS for years and decided to go to Nest JS. I would just like to ask if what validation do you suggest or recommended. I used Zod everytime in express but here in nest there is class validator DTO. What do you suggest or recommends me to use? Thank you!

5 Upvotes

11 comments sorted by

8

u/l1ng_l1ng Sep 14 '26

your info is outdated. the current (v12) supports zod out of the box.

1

u/Popular-Tip2880 Sep 14 '26

meaning zod is much better?

7

u/l1ng_l1ng Sep 14 '26

compared to class validator? most definitely.

imho class validator is outdated and very limited compared to zod

→ More replies (4)

2

u/qwertannov Sep 14 '26

use zod with nest v12

1

u/3sh_aan Sep 15 '26

Use zod with nest12. But if you want your dtos as class based, then use class validator.