inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

묻고 답해요

174만명의 커뮤니티!! 함께 토론해봐요.

postman 응답 처럼 swagger 에서도 success 를 추가할수 없을까요?

해결됨

탄탄한 백엔드 NestJS, 기초부터 심화까지

export class ResultDto<T> { @ApiProperty() success: boolean; @ApiProperty() data: T } // ---- cats.controller.ts @ApiResponse({ type: ResultDto<ReadOnlyCatDto> }) @Post() async signUp(@Body() body: CatRequestDto) { return await this.catsService.signUp(body); } 이런 식으로 단순하고 typescript 의 제네릭으로 해봤는데 안되어 질문들입니다.

  • swagger
  • nodejs
  • ApiResponse
  • express
  • mongodb
  • NestJS
  • ssr
박정근 댓글 1 좋아요 3 조회수 983

인기 태그

인프런 TOP Writers

주간 인기글