with SST how does everyone define all of their API...
# random
j
with SST how does everyone define all of their API Paths? I was interviewing with a company and in their technical challenge they insisted the API paths be defined via an OpenAPI file. I had not used an OpenAPI file since moving to CDK, I used it for one project with AWS SAM. I used SST for my solution, I found using
apigateway.SpecRestApi
to be limiting. I don't think the issue was AWS CDK, I think the issue is insisting on an OpenAPI file. So I'm just curious what do most companies use. Do many companies really use OpenAPI files?
c
We use OpenAPI and honestly we would be lost without it. We use OpenAPI to provide clear and easy to use documentation for developers and customers, but we also generate SDKs to be consumed by our frontend directly from the OpenAPI. Currently we are manually documenting our APIs. So backend engineer adds a new API endpoint and then updates the OpenAPI. Basically, for us at least, OpenAPI and CDK are mutually exclusive and not solving the same points so we need both.
j
Thanks Chad. When you say OpenAPI and CDK are mutually exclusive. Are you saying CDK deploys infrastructure and OpenAPI does not? OpenAPI is then a form of documentation?
c
Yeah exactly, I think you can use OpenAPI to deploy infra (using the
SpecRestApi
you mentioned I think) but we are using it purely as documentation. So for us they are solving 2 different pain points. That being said we are looking at automatically generating OpenAPI from CDK
j
You can export the OpenAPI file from the API gateway console after deployment, so I would expect it to be possible to do that programmatically as well.
c
Ha interesting, thanks, we didn't even consider that. Will give it a try and see how it works 😛
j
When you export it in the console there are many options. I know I had to do with api gateway <something> for it to work as an import to API gateway later.