I have common QueryOptionDto like
import { ApiProperty } from '@nestjs/swagger'
import { TransformArray } from '../decorators'
export class QueryOptionDto {
@ApiProperty({ example: 1 })
page?: number
@ApiProperty({ example: 10 })
limit?: number
@ApiProperty({ example: ['name:asc'] })
@TransformArray
sort?: string[]
}
and I use it in another Dto by extends it
export class GetUserDto extends QueryOptionDto {
@ApiProperty({ example: 'John'})
search? : string
}
then I use GetUserDto in controller
class UserController {
@Get()
get(@Query query : GetUserDto ) {
}
}
I dont want params page limit sort appear in controller but still in swagger. How can I achieve this?