br0wnf0x
7 months agoOccasional Visitor
passing url as variable to a swagger specification 2 file converts the double slash to 1 slash
We're currently using Terraform to pass a url to a swagger specification 2 file. When I passed in the variable the double slash on the url becomes 1 slash.
on the template, we have this:
paths:
/counties:
get:
operationId: GET /api/counties
x-google-backend:
address: "${myUrl}"
path_translation: APPEND_PATH_TO_ADDRESS
from terraform, I'm passing the variable like this:
openapi_documents {
document {
path = "spec.yaml"
contents = filebase64(templatefile("apigateway/openapi2-runner.tftplt",{myUrl = trimprefix(var.CrSrvApp,"https://"),urlprefix = "https://"}))
}
}
When then pipeline runs, it fails because the url on the swagger template file is "http:/www.testurl.com"
How to fix this?