一些dto.ts
export class CreateCatDto {
@ApiProperty()
name: string;
@ApiProperty()
age: number;
@ApiProperty()
breed: string;
}
我不想要这样的回应:
@ApiOkResponse(
description: 'Cat object',
type: CreateCatDto
)
但我的响应必须是类似 dto 对象的数组。我想要smth like soo
ApiOkResponse(
description: 'The record has been successfully removed.',
schema: {
type: 'array',
properties: {
obj: {
type: CreateCatDto
}
}
}
)