Skip to content

Instantly share code, notes, and snippets.

@samaratungajs
Created April 24, 2024 07:33
Show Gist options
  • Save samaratungajs/79efceb03d722c66cf17b40e096f217a to your computer and use it in GitHub Desktop.
Save samaratungajs/79efceb03d722c66cf17b40e096f217a to your computer and use it in GitHub Desktop.
NestJS 10 is incorrectly parsing the jsdocs comments to generate swagger docs
export class UserListFilterDto extends OffsetPaginationBaseDto {
/**
* Filter users by firstname lastname or email
* @example 'q'
* @type {string}
* @memberof UserListFilterDto
*/
@IsOptional()
@IsString()
query?: string;
/**
* Filter by user role
*
* @type {Roles}
* @memberof UserListFilterDto
*/
@IsOptional()
@IsEnum(Roles)
role?: Roles;
/**
* Sort users, defaulted to `desc` by `created at`
*
* @type {SortOrder}
* @memberof UserListFilterDto
*/
@IsOptional()
@IsEnum(SortOrder)
order?: SortOrder = SortOrder.DESC;
/**
* Sort users
*
* @type {UserListSortBy}
* @memberof UserListFilterDto
*/
@IsOptional()
@IsEnum(UserListSortBy)
sortBy?: UserListSortBy = UserListSortBy.CREATED_AT;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment