Closed ymhuang0808 closed 4 years ago
If the issue is confirmed, my teammate @marcuswu0814 would like to contribute it.
Yes, good catch! Feel free to submit a PR!
Hi @yonaskolb, currently I faced some problem when using Stencil, is it possible to escape {
and }
in this case:
// Stencil file
url = url.replacingOccurrences(of: "{{{variable.name}}}", with: {{variable.name}})
expected:
url = url.replacingOccurrences(of: "{version}", with: {{variable.name}})
Actual:
url = url.replacingOccurrences(of: "", with: {{variable.name}})
I can't found any document of escape character in Stencil web.
Yeah I've had this issue in the past. I've solved it before by doing something like this
"{" + "{{variable.name}}" + "}"
Hi @yonaskolb, thanks for your suggestion, the PR is done. 🚀
OpenAPI/Swagger provides Variable Server/Server Templating. In SwagGen, it also provides the feature. However, I found the replacing string may be wrong. Therefore, I would like to make sure that if it replaces the URL string with "variable value", instead of "variable name"
Actual
The line of code is:
The generated code is:
Expected
The line of code should look like:
The generated code should be: