Hello everyone. I'm new to nestjs and I faced an interesting issue that I struggle with.
I want to use a dto to validate params id property. The problem is that not every route handler uses its own id. I have a settings route that returns settings for a given facility by facilityId. The problem is that nestjs/swagger generates docs with the /id instead of the /facilityId. Is there any way to rename this property in each route handler or provide a description to swagger. Because DTO is reusable, but it's not obvious what exact id you should provide. I know that its probably the bad practice to structure your endpoint like this, but still.
export class FindOneParams {
@IsNumberString()
id: number;
}
@Get(':id')
@ApiParam({ name: 'id', type: String })
async findOne(@Param() { id: facilityId }: FindOneParams) {}