finds.dev

nestjs/swagger

OpenAPI (Swagger) module for Nest framework (node.js)

View on GitHubHomepage ↗

★ 1,899TypeScriptMITupdated Oct 2026

// the take

The official OpenAPI/Swagger module for NestJS — it reads your existing Nest decorators and DTO classes and generates a spec plus a hosted Swagger UI from them. For anyone building a Nest API who wants documentation without hand-writing or hand-syncing an OpenAPI YAML file.

The decorator set (@ApiProperty, @ApiOperation, @ApiResponse, etc.) sits directly on the controllers and DTOs you already have, so docs live next to the code instead of in a separate file. The CLI plugin is the real feature here — it's an AST transformer that reads your TypeScript types at compile time and synthesizes most of the schema automatically, cutting a lot of the decorator boilerplate other OpenAPI generators force on you. The type helpers (PartialType, OmitType, PickType, IntersectionType) let you derive request/response DTOs from a base class instead of copy-pasting fields across create/update/read variants. Coverage of newer OAS features (3.1, webhooks, callbacks) is kept current with the spec rather than frozen at 3.0.

It's generated from decorators, not from your actual validation or serialization logic, so there's nothing stopping the documented schema from drifting out of sync with what class-validator or your interceptors actually enforce and return at runtime — it documents intent, not behavior. Anything beyond plain DTOs (discriminated unions, generics, polymorphic responses) needs manual @ApiExtraModels/oneOf wiring because the inference doesn't follow those patterns well. The CLI plugin only runs through Nest's own build pipeline (nest-cli / its ts-jest transformer); projects on a different build chain (raw swc, esbuild, vite) lose the main value proposition and fall back to writing decorators by hand. And like the rest of the Nest ecosystem, this package is effectively maintained by one person (Kamil Myśliwiec) despite being a dependency nearly every Nest API in production relies on for its docs.

We read the README, the directory tree and a key source file in October 2026. Nobody pays to be listed. How we judge →

// at a glance

Stars
1,899
Forks
563
Language
TypeScript
License
MIT
Last commit
23 Oct 2026

// nearby

If swagger isn't quite it.

All repos →