Skip to content

Commit

Permalink
chore: add swagger decorators
Browse files Browse the repository at this point in the history
  • Loading branch information
tnramalho committed Jun 28, 2024
1 parent 054dcdc commit 9918c7b
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions packages/nestjs-cache/src/dto/cache.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Allow, IsOptional, IsString, ValidateNested } from 'class-validator';
import { ReferenceIdInterface } from '@concepta/ts-core';
import { CacheInterface } from '@concepta/ts-common';
import { CommonEntityDto, ReferenceIdDto } from '@concepta/nestjs-common';
import { ApiProperty } from '@nestjs/swagger';

/**
* Cache Create DTO
Expand All @@ -13,6 +14,10 @@ export class CacheDto extends CommonEntityDto implements CacheInterface {
* key
*/
@Expose()
@ApiProperty({
type: 'string',
description: 'key'

Check failure on line 19 in packages/nestjs-cache/src/dto/cache.dto.ts

View workflow job for this annotation

GitHub Actions / build (18.x)

Insert `,`
})
@IsString()
key = '';

Expand All @@ -21,13 +26,21 @@ export class CacheDto extends CommonEntityDto implements CacheInterface {
*/
@Expose()
@IsString()
@ApiProperty({
type: 'string',
description: 'data'

Check failure on line 31 in packages/nestjs-cache/src/dto/cache.dto.ts

View workflow job for this annotation

GitHub Actions / build (18.x)

Insert `,`
})
@IsOptional()
data!: string | null;

/**
* type
*/
@Expose()
@ApiProperty({
type: 'string',
description: 'type'

Check failure on line 42 in packages/nestjs-cache/src/dto/cache.dto.ts

View workflow job for this annotation

GitHub Actions / build (18.x)

Insert `,`
})
@IsString()
type = '';

Expand All @@ -38,6 +51,11 @@ export class CacheDto extends CommonEntityDto implements CacheInterface {
*/
@Expose()
@IsString()
@ApiProperty({
type: 'string',
description: 'type',
examples: ['60','2 days', '10h', '7d'],

Check failure on line 57 in packages/nestjs-cache/src/dto/cache.dto.ts

View workflow job for this annotation

GitHub Actions / build (18.x)

Replace `'2·days',·'10h',·'7d'],··` with `·'2·days',·'10h',·'7d'],`
})
@IsOptional()
expiresIn!: string | null;

Expand All @@ -46,6 +64,10 @@ export class CacheDto extends CommonEntityDto implements CacheInterface {
*/
@Expose()
@Type(() => ReferenceIdDto)
@ApiProperty({
type: ReferenceIdDto,
description: 'assignee'

Check failure on line 69 in packages/nestjs-cache/src/dto/cache.dto.ts

View workflow job for this annotation

GitHub Actions / build (18.x)

Insert `,`
})
@ValidateNested()
assignee: ReferenceIdInterface = new ReferenceIdDto();

Expand Down

0 comments on commit 9918c7b

Please sign in to comment.