It was an issue with global dependencies conflicting with local ones, as well as the old build (set to incremental mode) conflicting with the new property generation. Did the following to resolve the issue:

  • If nest cli is globally installed, manually upgrade it: yarn global upgrade upgrade @nestjs/cli, or with npm (npm update -g @nestjs/cli)
  • Upgrade local service nest to most recent version: nest update
  • Add the following to your nest-cli.json:
  "compilerOptions": {
    "plugins": ["@nestjs/swagger/plugin"]
  }
  • Remove your local dist folder (or do a yarn build)
  • Start the server with the nest cli commands (i.e. nest start or nest start:dev)
Answer from coler-j on Stack Overflow
🌐
GitHub
github.com › nestjs › swagger
GitHub - nestjs/swagger: OpenAPI (Swagger) module for Nest framework (node.js) :earth_americas: · GitHub
OpenAPI (Swagger) module for Nest. $ npm i --save @nestjs/swagger · Overview & Tutorial · Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please read more here. Author - Kamil Myśliwiec ·
Author   nestjs
Discussions

NestJS + Swagger: Any way to avoid writing everything manually for DTOs + file upload?
I'm currently using ts-rest and its client generation + automatic openApi generation from zod schema are very handy. After some research on this matter I found it's the best approach, you should give it a try ! Also tbh I had issues with typesafe file download (didn't try upload yet, my whole stack is not fully migrated to Nest + ts-rest yet) Edit: typos More on reddit.com
🌐 r/Nestjs_framework
5
11
June 19, 2025
NestJS/Swagger plugin with webpack and NX - Stack Overflow
I am trying to setup NestJS API in NX monorepo with @nestjs/swagger CLI plugin enabled. However, once I add the plugin into the webpack, I get error saying that the typescript emitted no output. Sp... More on stackoverflow.com
🌐 stackoverflow.com
NRWL + NestJS Trying to use Swagger plugin - Stack Overflow
I am using NRWL, I used it to generate a Nestjs + angular app, however, I am missing the Nest-cli.json file where I am trying to add the line "plugins": ["@nestjs/swagger/plugin"... More on stackoverflow.com
🌐 stackoverflow.com
CLI plugin does not with SWC
Is there an existing issue for this? I have searched the existing issues Current behavior Currently, the CLI plugin generates an invalid metadata.ts file. It uses invalid import paths on Windows, i... More on github.com
🌐 github.com
23
June 26, 2023
🌐
npm
npmjs.com › package › typescript-nestjs-swagger-plugin
typescript-nestjs-swagger-plugin - npm
@nestjs/swagger ttypescript plugin reduce the amount of boilerplate code required.. Latest version: 2.0.0, last published: 3 years ago. Start using typescript-nestjs-swagger-plugin in your project by running `npm i typescript-nestjs-swagger-plugin`. There are 1 other projects in the npm registry using typescript-nestjs-swagger-plugin.
      » npm install typescript-nestjs-swagger-plugin
    
Published   Jun 28, 2023
Version   2.0.0
🌐
NestJS
docs.nestjs.com › openapi › introduction
OpenAPI (Swagger) | NestJS - A progressive Node.js ...
Nest is a framework for building efficient, scalable Node.js server-side applications. It uses progressive JavaScript, is built with TypeScript and combines elements of OOP (Object Oriented Programming), FP (Functional Programming), and FRP (Functional Reactive Programming).
🌐
NestJS
docs.nestjs.com › openapi › cli-plugin
CLI Plugin - OpenAPI | NestJS - A progressive Node.js ...
Nest is a framework for building efficient, scalable Node.js server-side applications. It uses progressive JavaScript, is built with TypeScript and combines elements of OOP (Object Oriented Programming), FP (Functional Programming), and FRP (Functional Reactive Programming).
🌐
GitHub
github.com › sleeyax › nestjs-swagger-plugin
GitHub - sleeyax/nestjs-swagger-plugin: OpenAPI (Swagger) module for Nest framework (node.js) :earth_americas: · GitHub
OpenAPI (Swagger) module for Nest framework (node.js) :earth_americas: - sleeyax/nestjs-swagger-plugin
Author   sleeyax
🌐
npm
npmjs.com › package › @nestjs › swagger
nestjs/swagger
2 weeks ago - OpenAPI (Swagger) module for Nest. $ npm i --save @nestjs/swagger · Overview & Tutorial · Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please read more here. Author - Kamil Myśliwiec ·
      » npm install @nestjs/swagger
    
Published   Jul 17, 2026
Version   11.4.6
Find elsewhere
🌐
Reddit
reddit.com › r/nestjs_framework › nestjs + swagger: any way to avoid writing everything manually for dtos + file upload?
r/Nestjs_framework on Reddit: NestJS + Swagger: Any way to avoid writing everything manually for DTOs + file upload?
June 19, 2025 -

Hey guys, do I have to write everything manually to integrate Swagger with NestJS?
For example, do I really need to add code like this in every DTO?
@ApiProperty({

description: 'Username (3-20 characters, letters, numbers, underscore only)',

example: 'john_doe123',

minLength: 3,

maxLength: 20,

})

and doing the same for the response of each end point

I found the Swagger CLI plugin and installed it. It works, but not as expected.
The problem:

  • My API endpoint receives a CreateUserDto body and a file.

  • The file validation is handled in the controller.

  • The request should be multipart/form-data, but Swagger still shows application/json, and there's no info about the file.

  • The CLI generates something, but not what I need.

Any advice? Or a good video that covers this exact use case (DTO + file upload) without doing everything manually?

🌐
Trilon Consulting
trilon.io › blog › eliminating-redundancy-with-nestjs-cli-plugins
Eliminating Redundancy with NestJS CLI Plugins. Introducing Comments Introspection - Trilon Consulting
September 6, 2022 - Currently, NestJS provides two plugins useful for both: GraphQL code first applications (@nestjs/graphql), and REST APIs (@nestjs/swagger) that require interactive API documentation.
🌐
Medium
rehmat-sayany.medium.com › integrating-swagger-with-nestjs-a-step-by-step-guide-abd532743c43
Integrating Swagger with NestJS: A Step-by-Step Guide | by Rehmat Sayany | Medium
August 11, 2023 - Instead of just hosting, you have ... dropdown where we select the Server base URL. NestJS provides decorators that integrate seamlessly with Swagger to auto-generate documentation....
🌐
DEV Community
dev.to › ipreda › nx-nestjs-how-to-autogenerate-openapiswagger-specs-518n
Nx NestJs - How to autogenerate OpenApi/Swagger specs - DEV Community
May 9, 2022 - As you can notice we added a custom Webpack TsPlugin as specified in the documentation above this https://docs.nestjs.com/openapi/cli-plugin#integration-with-ts-jest-e2e-tests.
🌐
notiz
notiz.dev › blog › openapi-in-nestjs
OpenAPI for your REST APIs in NestJS - notiz.dev
July 28, 2021 - Exposing the properties and responses to Swagger results in additional boilerplate. Nest commes with a Swagger CLI Plugin to reduce boilerplate in your .dto.ts and .entity.ts files. Enable the plugin in your nest-cli.json file. { "collection": "@nestjs/schematics", "sourceRoot": "src", "compilerOptions": { "plugins": ["@nestjs/swagger"] } }
🌐
GitHub
github.com › nestjs › swagger › issues › 2493
CLI plugin does not with SWC · Issue #2493 · nestjs/swagger
June 26, 2023 - Is there an existing issue for this? I have searched the existing issues Current behavior Currently, the CLI plugin generates an invalid metadata.ts file. It uses invalid import paths on Windows, i...
Author   nestjs
🌐
DeepWiki
deepwiki.com › nestjs › docs.nestjs.com › 6-openapi-and-swagger
OpenAPI and Swagger | nestjs/docs.nestjs.com | DeepWiki
March 29, 2026 - OpenAPI is a language-agnostic definition format used to describe RESTful APIs, while Swagger UI provides an interactive interface to visualize and test your APIs. The OpenAPI specification enables developers to define the structure of their ...
🌐
GitHub
gist.github.com › nmchenry01 › 82266a629e2f379bcdf7986b4abb9592
NestJS CLI Swagger plugin "NestJS with Swagger" · GitHub
NestJS CLI Swagger plugin "NestJS with Swagger". GitHub Gist: instantly share code, notes, and snippets.