OpenAPITools / OpenAPITools/openapi-generator
[BUG] can't override model.mustache, api.mustache
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Description
The bug occurs when I provide a template folder for the generator, with model.mustache in it.
Instead of generating output, the tool just generates a stacktrace.
Looks like the problem doesn't happen if I replace other templates. Only models.mustache.
openapi-generator version
I used the docker-based openapi-generator-cli version 4.0.0-SNAPSHOT
I was trying to generate typescript-jquery output
I am using windows 10
OpenAPI declaration file content or url
The attached zip contains an OAS3 file sufficient to reproduce the bug
demo.zip
Command line used for generation
After setting everything up as described in steps to reproduce
docker run --rm -v "/tmp:/local" openapitools/openapi-generator-cli generate -i /local/demo.yaml -t /local/templates_folder -g typescript-jquery -o /local/output
Steps to reproduce
- download the openapi-generator tool
- create an empty /tmp/templates_folder
- copy the file openapi-generator-master\modules\openapi-generator\src\main\resources\typescript-jquery\model.mustache to /tmp/templates_folder
- create a demo.yaml file as described above, and put it in /tmp
- Run code generation using the OAS file and the themplates_folder
docker run --rm -v "/tmp:/local" openapitools/openapi-generator-cli generate -i /local/demo.yaml -t /local/templates_folder -g typescript-jquery -o /local/output
expected: since everything is standard and we are using standard templates, we expect to get the generated output.
Instead, we get a stacktrace, and error messages about the template not being found
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the typescript-jquery generator and the custom /tmp/templates_folder containing model.mustache, then run the Docker command from the report against the attached demo.yaml. Compare the model.mustache override with the other template overrides and confirm that generation completes without the reported stacktrace when the standard template is copied into the custom folder.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, java, jquery, typescript
- Domain
- api, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100