Hello World...
nest.js swagger 문서에서 특정 api 안 보이게 하기 본문
특정 api 메서드는 보이지 않게 하려고 한다.
이런 경우 @ApiExcludeEndpoint() 를 사용하면 된다.
import { Controller, Get } from '@nestjs/common';
import { ApiExcludeEndpoint } from '@nestjs/swagger';
import { AppService } from './app.service';
@Controller()
export class AppController {
constructor(private readonly appService: AppService) {}
@ApiExcludeEndpoint()
@Get()
getHello(): string {
return this.appService.getHello();
}
}
https://github.com/nestjs/swagger/issues/92
Feature Request: Turn off swagger for methods/controllers · Issue #92 · nestjs/swagger
I did not find how to turn off swagger for controllers/methods. It could be a good feature. If there is any way to turn off swagger, I will be grateful for explaining ho to do that.
github.com
'nest.js' 카테고리의 다른 글
swagger api 문서 페이지 접근시 아이디, 암호 인증 (0) | 2022.11.24 |
---|---|
nest.js "secretOrPrivateKey must have a value" error (0) | 2022.08.20 |
nest js dot env 환경에 따른 설정 (0) | 2022.08.20 |
Comments