Documenting an existing API

Adopt nestjs-docfy incrementally in a Nest project that already has Swagger set up.

Steps

  1. Install the package (see Installation).
  2. Register DocfyModule.forRoot() in your AppModule.
  3. Add @WithDocs() to an existing controller.
  4. Run npx nestjs-docfy generate (or --dry-run first, to preview what would be written) to generate the *.controller.docs.ts file alongside the controller, already pre-filled with summaries and responses inferred via docs(), without touching the controller's logic.
  5. Edit the generated file to fill in anything specific to your domain.
  6. Run npx nestjs-docfy coverage to measure progress and iterate.
  7. Once you're satisfied, enable DocfyModule.forRoot({ strict: true }) so that any controller marked without a docs file fails at startup.