{"repo":"Melvynx/next-zod-route","free":true,"listed":false,"github":"https://github.com/Melvynx/next-zod-route","clone":"git clone https://github.com/Melvynx/next-zod-route.git","description":"Create zod-safe route for your Next.js App Directory app","language":"TypeScript","stars":70,"topics":["api","api-route","nextjs","zod","nextjs15"],"license":"MIT","category":"api-integrations-sdks","readme_excerpt":"next-zod-route A fork from next-safe-route that uses zod for schema validation. next-zod-route is a utility library for Next.js that provides type-safety and schema validation for Route Handlers/API Routes. Features - ✅ Schema Validation: Automatically validates request parameters, query strings, and body content with built-in error handling. - 🧷 Type-Safe: Works with full TypeScript type safety for parameters, query strings, and body content. - 😌 Easy to Use: Simple and intuitive API that makes defining route handlers a breeze. - 🔄 Flexible Response Handling: Return Response objects directly or return plain objects that are automatically converted to JSON responses. - 🧪 Fully Tested: Extensive test suite to ensure everything works reliably. - 🔐 Enhanced Middleware System: Powerful middleware system with pre/post handler execution, response modification, and context chaining. - 🎯 Metadata Support: Add and validate metadata for your routes with full type safety. - 🛡️ Custom Error Handling: Flexible error handling with custom error handlers for both middleware and route handlers. Installation Or using your preferred package manager: Usage To define a route handler in Next.js: 1. Import createZodRoute and zod . 2. Define validation schemas for params, query, body, and metadata as needed. 3. Use createZodRoute() to create a route handler, chaining params , query , body , and defineMetadata methods. 4. Implement your handler function, accessing validated and type-safe param","default_branch":null,"files":null,"tree":[],"storefront":"/r/Melvynx","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/Melvynx/next-zod-route/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."}