Next REST Framework is an open-source, opinionated, lightweight, easy-to-use set of tools to build type-safe, self-documenting APIs with Next.js. Building OpenAPI specification-compliant REST APIs can be cumbersome and slow but Next REST Framework makes this easy with auto-generated OpenAPI documents and docs using TypeScript and object schemas.
Lightweight, type-safe, easy to use
- Designed to work with TypeScript so that your requests and responses are strongly typed.
- Object-schema validation with Zod. The object schemas are automatically converted to JSON schema format for the auto-generated OpenAPI specification.
- Auto-generated and extensible
openapi.json
spec file from your business logic. - Auto-generated Redoc and/or SwaggerUI documentation frontend.
- Works with Next.js Middleware and other server-side libraries, like NextAuth.js.
- Supports both Next.js app router and pages router, even at the same time.
- Fully customizable and compatible with any existing Next.js project.