All NestJS + Zod utilities you need
1.1k
Stars
108
Forks
22
Open issues
23
Contributors
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.
Inferred from signals mentioned in the README (tests, CI, type safety) — not a review of the actual code.
AI's overall editorial judgment — not an average of the bars above, can weigh other factors too.
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.
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.
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.
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.
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.
Not documented in README. CI badge present (test-and-build.yml workflow exists) but no explicit coverage metrics or test breakdown provided.
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.
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
- 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
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.
Explore similar
Newsletter
Get analyses like this every Monday
Free weekly digest of the most interesting open-source discoveries.
Languages
Information
- Language
- TypeScript
- License
- MIT
- Last updated
- 2d ago
- Created
- 51mo ago
- Analyzed with
- anthropic/claude-haiku-4-5
Stars over time
Contributors over time
Top 100 contributors only — repos with more will plateau at 100.
Open issues
Re-export isZodDto and ZodDto from the main entrypoint
Default values cause incorrect OpenAPI spec
zodV3ToOpenAPI emits nullable enums without null in the enum array (invalid OpenAPI 3.0) — #374/#376 fix doesn't reach the zod-3 path
`@Session` from `@thallesp/nestjs-better-auth` will throw with `strictSchemaDeclaration` enabled
Top contributors
Recent releases
Similar repos
fabien0102/ts-to-zod
ts-to-zod generates Zod validation schemas automatically from TypeScript types...
| Repository | Stars | Week Δ | Language | Score | Updated |
|---|---|---|---|---|---|
|
|
1.1k | +5 | TypeScript | 8/10 | 2d ago |
|
|
1.9k | — | TypeScript | 8/10 | 1w ago |
|
|
43.2k | — | TypeScript | 9/10 | 14h ago |
|
|
1.6k | — | TypeScript | 8/10 | 2w ago |
|
|
1.9k | — | TypeScript | 8/10 | 13h ago |
|
|
76.2k | — | TypeScript | 9/10 | 2h ago |
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.
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.
Full project template (4.3k stars). May or may not use nestjs-zod. Represents competing approach (boilerplate-first vs library-first validation).
Zod-based HTTP client library (1.9k stars). Different scope (client-side) but same ecosystem. Complementary, not competitive.
NestJS's default validation. nestjs-zod is an opt-in alternative targeting developers who prefer Zod's schema approach over decorator-based validation.