Could not find any reference in the docs so I'm gonna ask it here; is there a way to make NestJS automatically generate the default HttpException response type to all requests?
Say you have a controller with given @Get()
@ApiOkResponse({description: "Something happened"})
@ApiBadRequestResponse({description: "Something went wrong"})
@Get()
someTest() {
// ...
throw new HttpException('SomeTest', 400);
// ...
}
The resulting schema will have the bad request response type never instead of {statusCode: number, message: string}. Is there a way of generating this type automatically (for all requests)?
The 400 and 404 are examples here.