Reputation: 2159
How do you use the new swagger plugin? I have it in my compiler options:
"compilerOptions": {
"plugins": ["@nestjs/swagger/plugin"]
}
And I am running the application with nest start
as described: https://docs.nestjs.com/recipes/swagger#migration-to-40
However, no automated-magic documentation appears to be happening.
Upvotes: 9
Views: 11618
Reputation: 1
by adding reflect-metadata I was able to resolve the error ""@nestjs/swagger" plugin is not installed".
Upvotes: 0
Reputation: 1981
because I've spent hours on this and couldn't find this fix mentioned anywhere:
make sure you install the dependency reflect-metadata
. that's what I was missing
Upvotes: 0
Reputation: 143
My fix was:
I changed my filenames to one of the following suffixes: ['.dto.ts', '.entity.ts'] (e.g., create-user.dto.ts)
as described in the document:
https://docs.nestjs.com/openapi/cli-plugin
and then it worked for me.
Upvotes: 1
Reputation: 2159
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:
yarn global upgrade upgrade @nestjs/cli
, or with npm (npm update -g @nestjs/cli
)nest update
nest-cli.json
: "compilerOptions": {
"plugins": ["@nestjs/swagger/plugin"]
}
nest start
or nest start:dev
)Upvotes: 27
Reputation: 1373
My fix was...
The plugin filters the files it looks up based on a suffix rule.
Upvotes: 3
Reputation: 2817
for me it works with:
"plugins": [
"node_modules/@nestjs/swagger/plugin"
]
Upvotes: 0