File tree Expand file tree Collapse file tree
sample/11-swagger/src/cats Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import { CreateCatDto } from './dto/create-cat.dto';
44
55@Injectable ( )
66export class CatsService {
7- private readonly cats : CreateCatDto [ ] = [ ] ;
7+ private readonly cats : Cat [ ] = [ ] ;
88
99 create ( cat : CreateCatDto ) : Cat {
1010 this . cats . push ( cat ) ;
Original file line number Diff line number Diff line change 11import { ApiModelProperty } from '@nestjs/swagger' ;
22
33export 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}
You can’t perform that action at this time.
0 commit comments