It would probably be useful to add to the docs, but if you're just asking for how to do this:
const app = await NestFactory.create(ApplicationModule);
const options = new DocumentBuilder()
.setTitle("Title")
.setDescription("description")
.setVersion("1.0")
.build();
const document = SwaggerModule.createDocument(app, options);
fs.writeFileSync("./swagger-spec.json", JSON.stringify(document));
SwaggerModule.setup("/api", app, document);
await app.listen(80);
thanks @malbertSC
Or try to add -json at the end of your URL path, there is a hint about this in the doc : https://docs.nestjs.com/recipes/swagger
(Works with custom path, always add -json at the end of your URL)
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
It would probably be useful to add to the docs, but if you're just asking for how to do this: