so I have a route that can accept two different DTO's. I'm having difficulty getting these two DTO's to link/show up on swagger. I'm using the swagger plugin with NestJS. I know in raw swagger you can do something like. Any ideas?
Request:
oneOf:
- $ref: "#/components/schemas/RequestOneType"
- $ref: "#/components/schemas/RequestTwoType"
Any example of what I have right now is like
async initApp(@Body() req: RequestOneDto | RequestTwoDto , @Res({ passthrough: true }) res: Response) {
}
export class RequestOneDto { @Length(1,10); name: string
@Max(10) value: number }
export class RequestTwoDto { @Length(1,15); name: string
@Max(15) value: number
state: 'New York' }