forked from yy0ung/nibobnebob
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat : swagger 문서 작성을 위한 api decorator 추가 #35
- dto에 @ApiProperty 추가 - controller에 @ApiOperation, @ApiResponse 추가 Co-authored-by: GeunH <[email protected]>
- Loading branch information
Showing
2 changed files
with
17 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
import { ApiProperty } from "@nestjs/swagger"; | ||
import { | ||
IsBoolean, | ||
IsString, | ||
|
@@ -8,30 +9,42 @@ import { | |
} from "class-validator"; | ||
|
||
export class UserInfoDto { | ||
@ApiProperty({ | ||
example: "[email protected]", | ||
description: "The email of the user", | ||
}) | ||
@IsEmail() | ||
@IsNotEmpty() | ||
@MaxLength(50) | ||
email: string; | ||
|
||
@ApiProperty({ example: "1234", description: "The password of the user" }) | ||
@IsString() | ||
@IsNotEmpty() | ||
@MaxLength(50) | ||
password: string; | ||
|
||
@ApiProperty({ example: "naver", description: "The provider of the user" }) | ||
@IsString() | ||
@IsNotEmpty() | ||
@MaxLength(20) | ||
provider: string; | ||
|
||
@ApiProperty({ example: "test", description: "The nickname of the user" }) | ||
@IsString() | ||
@IsNotEmpty() | ||
@MaxLength(20) | ||
nickName: string; | ||
|
||
@ApiProperty({ example: 20, description: "The age of the user" }) | ||
@IsInt() | ||
@IsNotEmpty() | ||
age: number; | ||
|
||
@ApiProperty({ | ||
example: true, | ||
description: "The gender of the user. true is male, false is female", | ||
}) | ||
@IsBoolean() | ||
@IsNotEmpty() | ||
gender: boolean; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters