I am looking for a way to document the query params of type OrderQueryDto & PaginatedQueryDto
with the Nest Swagger-module. Is there a decorator like @ApiImplicityQueryString({ type: OrderQueryDto & PaginatedQueryDto })
?
I need a way to document query params of type OrderQueryDto & PaginatedQueryDto
when using the Nest Swagger-module. Is there a decorator I can use, such as @ApiImplicityQueryString({ type: OrderQueryDto & PaginatedQueryDto })
?
DTOs:
import { Transform } from 'class-transformer';
import { IsInt, IsOptional } from 'class-validator';
export class PaginatedQueryDto {
@IsInt()
@IsOptional()
@Transform(value => value && parseInt(value, 10))
take?: number;
@IsInt()
@IsOptional()
@Transform(value => value && parseInt(value, 10))
skip?: number;
}
import { IsInt, IsOptional, IsEnum } from 'class-validator';
import { Transform } from 'class-transformer';
import { OrderStatus } from './order.entity';
export class OrderQueryDto {
@IsInt()
@IsOptional()
@Transform(value => value && parseInt(value, 10))
reseller: number;
@IsInt()
@IsOptional()
@Transform(value => value && parseInt(value, 10))
customer: number;
@IsEnum(OrderStatus)
@IsOptional()
status: OrderStatus;
}
I need to document query params of type OrderQueryDto & PaginatedQueryDto
when using the Nest Swagger-module. Is there a decorator such as @ApiImplicityQueryString({ type: OrderQueryDto & PaginatedQueryDto })
?