Open jeeftor opened 3 years ago
I've downloaded the code and started digging around ... it does look like the template is asking for scriptName
which doesn't appear to be a valid value in the templateData
fed into the Dockerfile template....
So x-codegen-script-name
is getting set...
And here is a potential (maybe) fix:
In BashClientCodegen.java
if we add scriptName
as something set it DOES show up successfully in the Dockerfile
Additionally - we then get this working code block in docker:
I'm not sure what the correct fix is - however - whether the DockerTemplate should be updated or this is a specific Bash issue and the scriptName
variable isn't being set...
I may put together a PullRequest anyways and we'll see what happens
Bug Report Checklist
Description
When using what I think is valid commands with the bash generator I'm getting an invalid
Dockerfile
openapi-generator version
5.2.1
OpenAPI declaration file content or url
I'm using the sample pet store api: https://petstore.swagger.io/v2/swagger.json
Generation Details
I run the following:
Resultant
Dockerfile
looks like this:this implies to me the template https://github.com/OpenAPITools/openapi-generator/blob/0204bf4ae284d936e4f7cb1ffad314c04d5df9db/modules/openapi-generator/src/main/resources/bash/Dockerfile.mustache is not filling out the variable
{{scriptName}}
correctlyRelated issues/PRs
Active PR to fix this issue https://github.com/OpenAPITools/openapi-generator/pull/10594
Suggest a fix
I'll try to track down the code somehow - but obviously the
SCRIPT_NAME
variable isn't being populated correctly for some reason