Description
Description
Modified api.mustache template to replace localVarPath. In files where strings package is not already present by default, generator is not importing the lib for strings causing compilation failure. Manually adding the imports causes duplicate import error.
openapi-generator version
4.3.1
OpenAPI declaration file content or url
https://gist.github.com/shylasrinivas/ba6cc06dbc5a731b00f5d06d0bb6d8ee
Line in api.mustache causing this issue -
localVarPath = strings.Replace(localVarPath, "__", "?" , -1)
Command line used for generation
openapi-generator generate -g go -p enumClassPrefix=true -p structPrefix=true -t ~/bindings/templates -i hcl.yaml -o ~/bindings/hcl
Related issues/PRs
Suggest a fix
Used import alias functionality in go and added another import for strings Eg: strings and _strings. This fixes the compilation issue, however the code in the bindings does not look good.