Is there a way to generate API documentation from an AWS Lambda that's hooked to an API Gateway?

Viewed 344

So I have a Typescript (without Nest just vanilla TS) AWS Lambda that's hooked to an API Gateway and I'm trying to find a way to keep its documentation updated.

I was checking if somewhere I can define in my template.yml to mention/update the resource documentation (request/response) and then from the API Gateway I can export the swagger documentation or so but there is no support for that in the template file. (Unless I missed it)

I'm wondering if there is a way to generate the documentation directly from the lambda rather than from the API Gateway as the only way I found to get it is to update the API Gateway documentation manually using the AWS' console which is very manual and not dynamic

EDIT: Update, after some more research I found here a way to add documentation to apigateway endpoint but it means I will need to mention the location here and then re mention it in lambda part. Which can lead to the usual pitfalls of dirty programming, if I update the location of one and forget the 2nd shit will happen and it's a very bad practice

0 Answers
Related