typescript-rest
typescript-rest copied to clipboard
Response codes not appearing in generated swagger
So, not sure if I'm doing something incorrectly, but here, I use this code:
@Path('/test')
@POST
async test() {
throw new Errors.NotFoundError('Not Found');
}
Then I generate swagger. But the error response does not appear in generated swagger. Am I missing something?
I use typescript-rest-swagger to generate swagger based on my code and to show response in your swagger, you need to use the @Response decorator.
@Response<{ Your Response value }>(statusCode, message)
Try searching for the typescript-rest-swagger module.