Skip to content

Commit 54cccd0

Browse files
sample(swagger): fix typings, Cat class
1 parent 5936218 commit 54cccd0

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

sample/11-swagger/src/cats/cats.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { CreateCatDto } from './dto/create-cat.dto';
44

55
@Injectable()
66
export class CatsService {
7-
private readonly cats: CreateCatDto[] = [];
7+
private readonly cats: Cat[] = [];
88

99
create(cat: CreateCatDto): Cat {
1010
this.cats.push(cat);
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
import { ApiModelProperty } from '@nestjs/swagger';
22

33
export class Cat {
4-
5-
@ApiModelProperty({example: 'Kitty', description: 'The name of the Cat')
4+
@ApiModelProperty({ example: 'Kitty', description: 'The name of the Cat' })
65
name: string;
76

8-
@ApiModelProperty({example: 1, description: 'The age of the Cat'})
7+
@ApiModelProperty({ example: 1, description: 'The age of the Cat' })
98
age: number;
109

11-
@ApiModelProperty({example: 'Maine Coon', description: 'The breed of the Cat'})
10+
@ApiModelProperty({
11+
example: 'Maine Coon',
12+
description: 'The breed of the Cat',
13+
})
1214
breed: string;
1315
}

0 commit comments

Comments
 (0)