I'm struggling with the typing of my query params in NestJs, I have a route like this and I want to be able to filter my result with all the keys of my datamining entities. I did this and it's working but I can't find a way to make it appear in my swagger:
@Controller('datamining')
export class DataminingController {
@Get('short')
@ApiQuery({ required: false, type: DataminingShort }) // <== how to type this ? Obviously this one is not working.
findAll(@Query() options?: Partial<DataminingShort>) { // <== DataminingShort is an entity class for typeOrm
return this.dataminingShortService.findAll(options);
}
}
I want to avoid doing a specific class just for this since it's exactly the same properties as my typeOrm entity