{"repo":"BenLorantfy/nestjs-zod","free":true,"listed":false,"github":"https://github.com/BenLorantfy/nestjs-zod","clone":"git clone https://github.com/BenLorantfy/nestjs-zod.git","description":"All NestJS + Zod utilities you need","language":"TypeScript","stars":1110,"topics":["javascript","nest","nestjs","node","nodejs","typescript","zod","openapi"],"license":"MIT","category":"api-integrations-sdks","readme_excerpt":"nestjs-zod ✨ A seamless validation solution for your NestJS application ✨ by @benlorantfy Core Library Features ✨ Create nestjs DTOs from zod schemas ✨ Validate / parse request body, query params, and url params using zod ✨ Serialize response bodies using zod ✨ Automatically generate OpenAPI documentation using zod ✨ Supports zod codecs Sponsored by: apisandbox.dev Getting Started Automatic Setup nestjs-zod can be automatically setup by running the following command: This command runs a codemod that adds the validation pipe, serialization interceptor, http exception filter, and swagger cleanup function Alternatively, you can follow the manual setup steps below Manual Setup 1. Install the package: 2. Add ZodValidationPipe to the AppModule Show me how ZodValidationPipe is required in order to validate the request body, query, and params 3. Add ZodSerializerInterceptor to the AppModule Show me how ZodSerializerInterceptor is required in order to validate the response bodies 4. [OPTIONAL] Add an HttpExceptionFilter Show me how An HttpExceptionFilter is required in order to add custom handling for zod errors 5. [OPTIONAL] Add cleanupOpenApiDoc Important : This step is important if using @nestjs/swagger Show me how cleanupOpenApiDoc is required if using @nestjs/swagger to properly post-process the OpenAPI doc Check out the example app for a full example of how to integrate nestjs-zod in your nestjs application Documentation - Request Validation - createZodDto (Create a DTO from a Z","default_branch":null,"files":null,"tree":[],"storefront":"/r/BenLorantfy","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/BenLorantfy/nestjs-zod/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}