I know that Swagger integration for the API-gateway resources is on the CDK roadmap.
I think it can bring a lot of value, since at the moment, if you want to use (using CFN) a swagger file you can either inline it and reference CFN resources, or import it and not reference anything.
Typically, you'd want both - you want to separate the swagger file from your CFN/CDK code so that you can use all the fancy tools (UI editor / client generation / etc), but also usually you'd need to reference CFN resources (e.g. lambda integrations).
With CDK it can be possible to have a templated external swagger file, and use string replacements for the referenced resources.
Took this offline with @eladb who suggested something in the lines of:
new apigateway.RestApi(this, 'MyAPI', {
swagger: Swagger.load('/path/to/swagger', {
xxx: myLambdaFunction.functionName,
yyy: myAuthenticator.functionArn
}
});
I think it could bring huge value to CDK users as you can use the "API first" methodology and leverage all the existing swagger tools.
I know that Swagger integration for the API-gateway resources is on the CDK roadmap.
I think it can bring a lot of value, since at the moment, if you want to use (using CFN) a swagger file you can either inline it and reference CFN resources, or import it and not reference anything.
Typically, you'd want both - you want to separate the swagger file from your CFN/CDK code so that you can use all the fancy tools (UI editor / client generation / etc), but also usually you'd need to reference CFN resources (e.g. lambda integrations).
With CDK it can be possible to have a templated external swagger file, and use string replacements for the referenced resources.
Took this offline with @eladb who suggested something in the lines of:
I think it could bring huge value to CDK users as you can use the "API first" methodology and leverage all the existing swagger tools.