🌐
NestJS
docs.nestjs.com › pipes
Documentation | NestJS - A progressive Node.js framework
Nest is a framework for building efficient, scalable Node.js server-side applications. It uses progressive JavaScript, is built with TypeScript and combines elements of OOP (Object Oriented Programming), FP (Functional Programming), and FRP ...
🌐
GitHub
github.com › BenLorantfy › nestjs-zod
GitHub - BenLorantfy/nestjs-zod: All NestJS + Zod utilities you need · GitHub
All NestJS + Zod utilities you need. Contribute to BenLorantfy/nestjs-zod development by creating an account on GitHub.
Starred by 1.1K users
Forked by 110 users
Languages   TypeScript 87.2% | JavaScript 12.8%
Discussions

Develop the @nestjs/zod package to simplify integration between Nest and Zod.
Is there an existing issue that is already proposing this? I have searched the existing issues Is your feature request related to a problem? Please describe it In NestJS, input parameter validation is a crucial aspect. Currently, there a... More on github.com
🌐 github.com
10
November 28, 2025
Using global ZodValidationPipe (nestjs-zod) to validate body that is an array of objects? - Stack Overflow
I would very much like to make use of the fact that I have global ZodValidationPipe set up so that I don't have to do double work every time, e.g. More on stackoverflow.com
🌐 stackoverflow.com
OpenAPI validation for NestJS with Zod
What's the advantage of this over something like class-validator? More on reddit.com
🌐 r/nestjs
6
17
December 30, 2025
New class-based validation package: DTO Classes
One of my biggest complaints with the class-validator and class-transformer setup that NestJS shows is that you can't derive similar versions of classes. There exists the mapped-types helpers, but they don't work in the browser because they import a bunch of browser-incompatible nestjs things. You have to shim webpack if you want to use those for shared DTOs. Can you imagine a way to solve this in your library? More on reddit.com
🌐 r/nestjs
5
8
June 4, 2023
🌐
Reddit
reddit.com › r/nestjs_framework › zod validation
r/Nestjs_framework on Reddit: zod validation
August 13, 2025 -

hey guys, I'm new at nestjs framework and better to know that I'm a front-end developer! would you please let me know how may I use zod schemas as validator in nestjs as well? I have added nestjs-zod's validator as app module provider and converted the schema to dto using createZodDto method of the package although I get any type when I import the exported class that is extended the createZodDto(MY_ZOD_SCHEMA)!

🌐
Zod
zod.dev › ecosystem
Ecosystem | Zod
Overview of the Zod ecosystem including integrations, tools, and community resources
🌐
npm
npmjs.com › package › nestjs-zod
nestjs-zod - npm
May 15, 2026 - Providing a compile-time typescript type from the Zod schema · Providing an OpenAPI schema when using nestjs/swagger
      » npm install nestjs-zod
    
Published   Jul 25, 2026
Version   5.5.0
🌐
Medium
medium.com › @juliojordan › nestjs-and-zod-eff1e3892c05
NestJS and Zod. Save you from the decorator hell by… | by Julio Jordan | Medium
October 14, 2023 - Keeping the validation of the request ... This is what I mean by decorator hell. Zod is a friendly alternative to the class-validator library for validating the request body....
🌐
GitHub
github.com › nestjs › nest › issues › 15988
Develop the @nestjs/zod package to simplify integration between Nest and Zod. · Issue #15988 · nestjs/nest
November 28, 2025 - In NestJS, input parameter validation is a crucial aspect. Currently, there are two approaches: one uses class-validator and class-transformer, but both packages are inactive, with no updates for over two years. The other approach is using zod, but it lacks integration with NestJS.
Author   nestjs
🌐
npm
npmjs.com › package › @anatine › zod-nestjs
@anatine/zod-nestjs - npm
Zod helper methods for NestJS. Latest version: 2.0.12, last published: a year ago. Start using @anatine/zod-nestjs in your project by running `npm i @anatine/zod-nestjs`. There are 11 other projects in the npm registry using @anatine/zod-nestjs.
      » npm install @anatine/zod-nestjs
    
Published   Apr 05, 2025
Version   2.0.12
Find elsewhere
🌐
Zod
zod.dev
Intro | Zod
Using Zod, you can define schemas you can use to validate data, from a simple string to a complex nested object.
🌐
iSpeech
zignuts.com › question-and-answer › how-to-use-zod-with-nestjs-pipes-for-runtime-schemas
Using Zod with NestJS Pipes
March 18, 2026 - NestJS integrates Zod via custom pipes that parse/validate incoming data against schemas at runtime, providing client-bundleable validation separate from TypeScript types. Create ZodValidationPipe using zod.toParsedSchema() for transformation; ...
🌐
Medium
rifatcse09.medium.com › why-zod-over-traditional-nestjs-dtos-with-full-implementation-a20b145768a9
Why Zod Over Traditional NestJS DTOs (with Full Implementation) | by Rifat | Medium
March 1, 2026 - // user.controller.ts import { Body, Controller, Post } from "@nestjs/common"; import { CreateUserDto } from "./create-user.dto"; @Controller("users") export class UserController { @Post() create(@Body() dto: CreateUserDto) { return { message: "User created", data: dto }; } } Note: In real apps, you usually enable this globally: app.useGlobalPipes(new ValidationPipe({ whitelist: true, transform: true })); ... //user.schema.ts import { z } from "zod"; export const createUserSchema = z.object({ email: z.string().email(), password: z.string().min(8), }); export type CreateUserInput = z.infer<typeof createUserSchema>;
🌐
DEV Community
dev.to › abdulghofurme › zod-vs-class-validator-class-transformer-3oam
zod vs class-validator & class-transformer - DEV Community
December 28, 2024 - class-validator & class-transformer are the 2 packages most commonly used as validation in NestJS, yes, apart from the fact that the writing method is the same as NestJS using decorator-based, also because it is clean & seamless because it can be used with ValidationPipe as DTO. So, the incoming data/payload received by the controller has been validated and changed/transformed according to its definition. Meanwhile zod still needs to validate the data/payload it receives manually, yes, maybe only 1 or a maximum of 3 lines, but of course, the more validation functions are needed the more manual processes are required.
🌐
HackMD
hackmd.io › UVRGb-LoQPK7a2Obls_iAw
Deep Dive: NestJS + Zod Integration Architecture - HackMD
NestJS parses @Body() decorator, gets request.body const bodyData = request.body; // 2. NestJS gets parameter type through TypeScript metadata const parameterType = UserDto; // ← Retrieved from TypeScript reflection // 3. Execute global ZodValidationPipe.transform() const validatedData = zodValidationPipe.transform(bodyData, { metatype: UserDto, // ← This is key!
🌐
Medium
medium.com › nestjs-ninja › creating-a-configuration-module-like-a-specialist-with-zod-inside-nestjs-c61430de896b
Creating a configuration module like a specialist with Zod inside NestJS | by Henrique Weiand | NestJS Ninja | Medium
October 10, 2023 - To learn more about ZOD, please check out this link. The method z.infer in this example is what creates the magic of having a type automatically. Next, let’s edit our env.service.ts and here we just need to something like this · import { Injectable } from '@nestjs/common'; import { ConfigService } from '@nestjs/config'; import { Env } from './env';
🌐
Stack Overflow
stackoverflow.com › questions › 77096252 › using-global-zodvalidationpipe-nestjs-zod-to-validate-body-that-is-an-array-of
Using global ZodValidationPipe (nestjs-zod) to validate body that is an array of objects? - Stack Overflow
I registered ZodValidationPipe globally within my root nestjs Module per documentation: { provide: APP_PIPE, useClass: ZodValidationPipe, }, and that seems to be generally working - as long as what I'm validating isn't an array.
🌐
GitHub
github.com › BenLorantfy › nestjs-zod › issues
Issues · BenLorantfy/nestjs-zod
All NestJS + Zod utilities you need. Contribute to BenLorantfy/nestjs-zod development by creating an account on GitHub.
Author   BenLorantfy
🌐
DEV Community
dev.to › bbescort-team › security-by-design-with-nestjs-zod-ts-rest-and-custom-in-house-frameworks-488n
Security by Design with NestJS, zod, ts-rest, and Custom In-House Frameworks - DEV Community
September 3, 2025 - Implemented via NestJS Guards and decorators. Principle: Least Privilege – narrow, task-focused scopes. Centralized logging (e.g., ELK / Datadog) with anomaly detection. Alerts on suspicious patterns (login abuse, unusual data exports). We use ts-rest combined with Zod to strictly validate both requests and responses.
🌐
Medium
medium.com › @priyansu011 › level-up-your-nestjs-dtos-input-validation-and-serialization-with-zod-e990ab8420a7
Level-Up Your NestJS DTOs: Input Validation and Serialization with Zod | by Priyanshu Rajput | Medium
September 25, 2025 - NestJS ships with powerful decorators like @IsString() and @IsNotEmpty() (via class-validator). They work well for most cases—but if you’ve ever wished for: ... In this post, I’ll walk you through replacing the classic class-validator DTO with a Zod schema, show how to integrate it in a NestJS service, and explain why Zod can simplify your entire validation story.
🌐
Reddit
reddit.com › r/nestjs › openapi validation for nestjs with zod
OpenAPI validation for NestJS with Zod : r/nestjs
December 30, 2025 - Probably Notting. Great if you like Zod things or maybe want to copy same schemas for frontend ... Thats pretty nice, I have been experimenting with using nestjs-zod, but this seems maybe more efficient.
🌐
Medium
medium.com › @rotemdoar17 › nestjs-environment-configuration-using-zod-92e3decca5ca
NestJS Environment Configuration Using Zod | by Rotemdoar | Medium
August 9, 2025 - In this guide, I’ll show how I combined NestJS’s @nestjs/config with Zod, a TypeScript-first schema validation library, to create type-safe environment setup.