-
-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(api): Add swagger docs of User Controller (#166)
- Loading branch information
Showing
5 changed files
with
125 additions
and
4 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
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export const invalidAuthenticationResponse = { | ||
description: 'Invalid authentication header or API key' | ||
} |
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
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
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,21 +1,77 @@ | ||
import { IsBoolean, IsOptional, IsString } from 'class-validator' | ||
import { ApiProperty } from '@nestjs/swagger' | ||
import { IsBoolean, IsEmail, IsOptional, IsString } from 'class-validator' | ||
|
||
export class CreateUserDto { | ||
@IsString() | ||
@IsOptional() | ||
@ApiProperty({ | ||
name: 'name', | ||
description: 'Full name of the user', | ||
required: false, | ||
type: String, | ||
example: 'John Doe', | ||
default: null | ||
}) | ||
name: string | ||
|
||
@IsString() | ||
@IsEmail() | ||
@ApiProperty({ | ||
name: 'email', | ||
description: 'Email of the user', | ||
required: true, | ||
type: String, | ||
example: '[email protected]', | ||
format: 'email', | ||
uniqueItems: true | ||
}) | ||
email: string | ||
|
||
@IsString() | ||
@IsOptional() | ||
@ApiProperty({ | ||
name: 'profilePictureUrl', | ||
description: 'URL of the user profile picture', | ||
required: false, | ||
type: String, | ||
example: 'https://example.com/profile.jpg', | ||
default: null | ||
}) | ||
profilePictureUrl: string | ||
|
||
@IsBoolean() | ||
@IsOptional() | ||
@ApiProperty({ | ||
name: 'isActive', | ||
description: 'Is the user active', | ||
required: false, | ||
type: Boolean, | ||
example: true, | ||
default: true | ||
}) | ||
isActive: boolean | ||
|
||
@IsBoolean() | ||
@IsOptional() | ||
@ApiProperty({ | ||
name: 'isOnboardingFinished', | ||
description: 'Is the user onboarding finished', | ||
required: false, | ||
type: Boolean, | ||
example: true, | ||
default: false | ||
}) | ||
isOnboardingFinished: boolean | ||
|
||
@IsBoolean() | ||
@IsOptional() | ||
@ApiProperty({ | ||
name: 'isAdmin', | ||
description: 'Is the user an admin', | ||
required: false, | ||
type: Boolean, | ||
example: false, | ||
default: false | ||
}) | ||
isAdmin: boolean | ||
} |