Adapters
Adapters overview
One adapter per Node.js framework — same docs UI, same OpenAPI export, same schemas.
DocTreen ships an adapter for each supported Node.js framework. They all:
- Accept the same config object
- Serve the docs UI at
docsPath(default/docs) - Expose OpenAPI 3.1 at
<docsPath>/openapi.json - Accept Zod schemas, the
sbuilder, JSDoc, or framework-native schemas (Fastify) - Support runtime validation, drift detection, and flows
| Adapter | Import | Mount order | Schemas read from |
|---|---|---|---|
| Express | doctreen/express | After routes | defineRoute → JSDoc → runtime inference |
| Fastify | doctreen/fastify | Before routes | defineRoute → Fastify native JSON Schema → JSDoc |
| Hono | doctreen/hono | Either order | defineRoute → JSDoc |
| Koa | doctreen/koa | Either order | defineRoute → JSDoc |
| NestJS | doctreen/nest | After NestFactory.create(), before listen() | @DocRoute / @Doc* decorators |