You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But aws_api_gateway_rest_api actually accepts a yaml string just as well. I.e. the following works:
data "template_file" "swagger_api" {
template = file("./swagger.yaml")
vars = {
...
}
}
resource "aws_api_gateway_rest_api" "this" {
count = local.enabled ? 1 : 0
name = module.this.id
body = data.template_file.swagger_api.rendered
tags = module.this.tags
endpoint_configuration {
types = [var.endpoint_type]
}
}
The easiest solution would probably be to just remove the jsonencode() part and let the caller do that if needed. Optionally we could add another variable instead for backwards compatibility.
Another upside to getting rid of the jsonencode is supporting the case where the caller already has the body as json, for example when reading a json file.
The text was updated successfully, but these errors were encountered:
It would be nice if we could also support yaml format API body. Currently doing the
jsonencode(..)
here restricts us to only providing a OpenAPI map:terraform-aws-api-gateway/main.tf
Line 13 in d11aaba
But
aws_api_gateway_rest_api
actually accepts a yaml string just as well. I.e. the following works:The easiest solution would probably be to just remove the
jsonencode()
part and let the caller do that if needed. Optionally we could add another variable instead for backwards compatibility.Another upside to getting rid of the jsonencode is supporting the case where the caller already has the body as json, for example when reading a json file.
The text was updated successfully, but these errors were encountered: