BenLorantfy

BenLorantfy/nestjs-zod

TypeScript MIT Web Dev

All NestJS + Zod utilities you need

1.1k stars
108 forks
active
GitHub +5 / week

1.1k

Stars

108

Forks

22

Open issues

23

Contributors

v5.4.0 15 May 2026

AI Analysis

nestjs-zod integrates Zod schema validation into NestJS applications, providing DTO generation, request/response validation, serialization, and automatic OpenAPI documentation. It serves teams building NestJS APIs who want type-safe validation using Zod schemas; it is specialized for the NestJS + Zod ecosystem and not applicable to other frameworks or validation libraries.

Web Dev Library Discovery value: 6/10
Documentation 8/10
Activity 9/10
Community 8/10
Code quality 7/10

Inferred from signals mentioned in the README (tests, CI, type safety) — not a review of the actual code.

Overall score 8/10

AI's overall editorial judgment — not an average of the bars above, can weigh other factors too.

nestjs-integration zod-validation schema-driven openapi-generation typescript
Actively maintained Well documented MIT licensed Niche/specialized use case Beginner friendly Production ready
Deep Analysis · Based on README and public signals
3d ago

NestJS-native Zod integration for validation, serialization, and OpenAPI docs

nestjs-zod provides a unified validation and serialization layer for NestJS applications using Zod schemas. It bridges NestJS and Zod by offering request validation (body, query, params), response serialization, and automatic OpenAPI schema generation. The project targets TypeScript/NestJS developers seeking type-safe, schema-driven validation as an alternative to class-validators. Adoption appears modest but deliberate, concentrated among projects valuing Zod's ecosystem.

Origin

Created May 2022 during Zod's rise in TypeScript ecosystems. Emerged as a pragmatic adapter layer when NestJS's native validation story remained tied to class-transformer/class-validator. Represents a response to demand for Zod integration in opinionated frameworks.

Growth

Steady but slow growth trajectory: 1,080 stars over 4+ years suggests adoption in a specific niche rather than rapid mainstream uptake. Recent activity (last push July 2026) indicates active maintenance. Growth appears driven by organic adoption within Zod-preferring teams rather than marketing or viral adoption.

In production

Adoption not verified through README. No case studies, testimonials, or deployment numbers documented. npm weekly downloads badge referenced but specific count not provided in excerpt. Small but non-zero fork count (108) suggests some integration into existing projects. Lack of explicit production evidence makes real adoption scale unclear.

Code analysis
Architecture

Based on README, appears to follow NestJS provider patterns: exposes ZodValidationPipe (validation), ZodSerializerInterceptor (response handling), and exception filters. Supports Zod codecs and integrates with @nestjs/swagger. Likely leverages NestJS's middleware/pipe/interceptor hooks rather than replacing core validation entirely. Exact composition unclear from README alone.

Tests

Not documented in README. CI badge present (test-and-build.yml workflow exists) but no explicit coverage metrics or test breakdown provided.

Maintenance

Last push 2026-07-01 (6 days before evaluation date). Active CI/CD pipeline. Only 2 stars gained in past 7 days, consistent with historical slow-growth pattern. No evidence of abandonment, but also no acceleration or major recent releases documented in README.

Honest verdict

ADOPT IF: your team standardizes on Zod schemas, requires type-safe validation throughout request/response pipeline, and values automatic OpenAPI generation from schemas. You are already using NestJS and want to reduce duplication between validators and documentation. AVOID IF: you are deeply invested in NestJS class-validator patterns, need maximum ecosystem plugin breadth, or require extensive third-party integrations not yet ported to Zod. Your team should validate Zod adoption readiness first. MONITOR IF: you are evaluating whether to add Zod to an existing NestJS codebase; the project is stable and maintained but adoption remains niche enough that fewer integrations may exist than for class-validator.

Independent dimensions

Mainstream potential

3/10

Technical importance

6/10

Adoption evidence

2/10

Risks
  • Adoption appears limited to Zod-preferring teams; migration friction from class-validator is real if your codebase is large
  • Reliance on Zod upstream; breaking changes in Zod 4.x or future majors could require updates
  • Test coverage not documented; implementation quality beyond README claims cannot be verified
  • Single maintainer (inferred from repository structure); bus factor risk if maintainer loses availability
  • OpenAPI generation quality (cleanupOpenApiDoc) depends on @nestjs/swagger integration; divergence risk if Swagger evolves
Prediction

Likely to remain a stable, niche tool for Zod-native NestJS teams. Slow growth suggests it has found its audience (Zod + NestJS developers) without mainstream breakthrough. Maintenance will probably continue but dominance over class-validator patterns is unlikely.

0 found this helpful

Newsletter

Get analyses like this every Monday

Free weekly digest of the most interesting open-source discoveries.

Languages

TypeScript
87.2%
JavaScript
12.8%

Information

Language
TypeScript
License
MIT
Last updated
2d ago
Created
51mo ago
Analyzed with
anthropic/claude-haiku-4-5

Stars over time

Loading…

Contributors over time

Top 100 contributors only — repos with more will plateau at 100.

Loading…

Similar repos

ecyrbe

ecyrbe/zodios

Zodios is a TypeScript HTTP client and optional server framework that combines...

1.9k TypeScript Web Dev
colinhacks

colinhacks/zod

Zod is a TypeScript-first schema validation library that combines runtime...

43.2k TypeScript Dev Tools
fabien0102

fabien0102/ts-to-zod

ts-to-zod generates Zod validation schemas automatically from TypeScript types...

1.6k TypeScript Dev Tools
nestjs

nestjs/swagger

This is an OpenAPI (Swagger) integration module for NestJS, enabling developers...

1.9k TypeScript Dev Tools
nestjs

nestjs/nest

NestJS is a TypeScript-first Node.js server-side framework that combines OOP,...

76.2k TypeScript Web Dev
vs. alternatives
colinhacks/zod

Core schema library (43k stars). nestjs-zod is a consumer, not a competitor; depends on Zod. Zod handles schema definition; nestjs-zod handles NestJS integration.

nestjs/swagger

Provides OpenAPI generation in NestJS. nestjs-zod handles both validation AND docs. Direct overlap in docs generation, but different schema source (Zod vs decorators). Likely used together.

brocoders/nestjs-boilerplate

Full project template (4.3k stars). May or may not use nestjs-zod. Represents competing approach (boilerplate-first vs library-first validation).

ecyrbe/zodios

Zod-based HTTP client library (1.9k stars). Different scope (client-side) but same ecosystem. Complementary, not competitive.

NestJS class-validator/class-transformer

NestJS's default validation. nestjs-zod is an opt-in alternative targeting developers who prefer Zod's schema approach over decorator-based validation.