Reputation: 195
I'm creating a POST endpoint that will receive an object with one property: returnIds. This return ids will be an array of NUMBERS
{
"returnIds": [1, 2, 3, 4, 5]
}
For this i create this DTO
@ApiProperty()
returnIds: number[]
The problem is that swagger is showing me this
what i need to change that the shown example is instead "string" a 0 or something related with a number?
This is my endpoint
Thank u a lot
Upvotes: 3
Views: 3053
Reputation: 70111
You can use @ApiProperty({ type: [Number] })
to designate it's supposed to be an array of numbers. Just like it's mentioned in the docs
Upvotes: 4