admin管理员组文章数量:1332890
I'm new to NestJs and facing this problem while documenting my apis: when I click to preview an endpoint, all endpoints in that controller will auto expand/collapse, and my page will jump to the first endpoint in the current controller.
My config:
async function bootstrap() {
const app = await NestFactory.create(AppModule);
app.setGlobalPrefix("api");
app.enableCors();
app.useGlobalPipes(
new ValidationPipe({
whitelist: true,
forbidNonWhitelisted: true,
transform: true,
}),
);
const swaggerConfig = new DocumentBuilder()
.setTitle("Example API")
.setDescription("Example API description")
.setVersion("1.0")
.addBearerAuth()
.build();
const documentFactory = () =>
SwaggerModule.createDocument(app, swaggerConfig);
SwaggerModule.setup("api", app, documentFactory);
await app.listen(config.PORT);
console.log(`Server is running on http://localhost:${config.PORT}/api`);
if (module.hot) {
module.hot.accept();
module.hot.dispose(() => app.close());
}
}
Does anyone have the same issue ?
This repo has older library version and it works without my issue: . So I wonder if the expand/collapse all endpoints is an upgrade feature of @nestjs/swagger :)
本文标签: nestjsDisable expandcollapse controller39s endpointsStack Overflow
版权声明:本文标题:nestjs - Disable expandcollapse controller's endpoints - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742309311a2450545.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论