DocTreen
Adapters

Adapters overview

One adapter per framework — same docs UI, same OpenAPI export, same schemas, in Node.js, Python, and PHP.

DocTreen ships an adapter for each supported framework. They all:

  • Accept the same config object
  • Serve the docs UI at docsPath (default /docs) — the same zero-dependency UI in every language (the Python and PHP packages ship the exact assets the npm package builds)
  • Expose OpenAPI 3.1 at <docsPath>/openapi.json — held identical across languages by a shared conformance suite
  • Support runtime validation and drift detection

Node.js

AdapterImportMount orderSchemas read from
Expressdoctreen/expressAfter routesdefineRoute → JSDoc → runtime inference
Fastifydoctreen/fastifyBefore routesdefineRoute → Fastify native JSON Schema → JSDoc
Honodoctreen/honoEither orderdefineRoute → JSDoc
Koadoctreen/koaEither orderdefineRoute → JSDoc
NestJSdoctreen/nestAfter NestFactory.create(), before listen()@DocRoute / @Doc* decorators

Python

AdapterImportMount orderSchemas read from
Flaskdoctreen.adapters.flaskEither order (introspection runs on first docs request)@define_route (Pydantic or s.*) → Flask URL converters
FastAPIdoctreen.adapters.fastapimount_doctreen(app, …) any timeThe app's own app.openapi() spec (drift-focused; mounts at /doctreen)
Django / DRFdoctreen.adapters.django*doctreen_urls(…) in urlpatterns (+ middleware for drift)DRF serializers → URLconf path() converters

PHP

AdapterInstallMount orderSchemas read from
Laravelauto-discovered service providerAutomatic->doc() route macro (S:: builder)

Planned

Symfony and PSR-15 adapters are on the PHP roadmap.

On this page