typescript-rest icon indicating copy to clipboard operation
typescript-rest copied to clipboard

Response codes not appearing in generated swagger

Open nudabagana opened this issue 4 years ago • 1 comments

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?

nudabagana avatar Jun 04 '20 13:06 nudabagana

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.

rlcjf0014 avatar Jul 14 '20 05:07 rlcjf0014