Skip to content

[type-safe-api] Inject variables in Open API spec #541

Closed Answered by cogwirrel
valebedu asked this question in Q&A
Discussion options

You must be logged in to vote

Hey!

TypeSafeApi uses "Integrations" to construct the x-amazon-apigateway-integration part of the OpenAPI spec through CDK, rather than through variables in your template.

You can achieve the same as your above example by implementing a "custom integration" (see docs here).

Essentially, you can extend the Integration class and implement the render method to return the x-amazon-apigateway-integration part of the spec for your specific integration. See here for how Integrations.lambda is implemented for a simple example, or here for a more complex example for a Network Load Balancer.

Hope that helps!

Cheers,
Jack

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@valebedu
Comment options

Answer selected by valebedu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants