Back to results
bufferings/hello-zod4-openapi-hono(opens in a new tab)
Language: TypeScript
- stars
- 6
- watchers
- 0
- forks
- 0
- open issues
- 0
- Last updated
- 01/12/2026
Language: TypeScript
Hono + Zod OpenAPI sample project with Node.js.
This project demonstrates two approaches to define OpenAPI schemas with Zod:
.openapi() from @hono/zod-openapi.meta() from pure zodBoth apps implement the same POST /users endpoint with identical functionality.
# Install tools mise install # Setup corepack and git hooks mise run setup # Install dependencies pnpm install
# Start development servers pnpm start1 # Port 8000 pnpm start2 # Port 8001 # Compare OpenAPI docs pnpm compare # Format code pnpm fmt # Check formatting pnpm fmt:check # Run linter pnpm lint
src/
├── app1/ # Using .openapi() approach
│ ├── usecase.ts # Business logic with Result type
│ ├── handler.ts # Route definitions and handlers
│ ├── app.ts # App setup and OpenAPI docs
│ └── server.ts # Server startup
└── app2/ # Using .meta() approach
├── usecase.ts # Business logic with Result type
├── handler.ts # Route definitions and handlers
├── app.ts # App setup and OpenAPI docs
└── server.ts # Server startup
.openapi({ description: "..." }) from @hono/zod-openapiimport { z } from "@hono/zod-openapi".meta({ description: "..." }) from pure zodimport { z } from "zod"Both approaches result in the same OpenAPI document.