nest.js
nest.js swagger 문서에서 특정 api 안 보이게 하기
FaustK
2023. 2. 17. 09:09
특정 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