Various OpenAPI generators utilize Mustache as their template engine for creating different artifacts.
In this specific scenario, the version details are specified in licenseInfo.mustache
.
This particular template is incorporated into other templates used for generating various client artifacts.
If you wish to do so, you can edit this template and input your own version. The OpenAPI generator allows users to override existing templates.
Once modified, you will need to configure the tool (CLI, Maven, Gradle) you are using as your generator to specify where the modified template is located.
If needed, you can even create your custom user defined templates.
Another approach could involve defining a form of file post-processing logic that runs after the generation process is complete.
For the typescript-rxjs
generator, the code to be executed should be set as a string value in the environment variable TS_POST_PROCESS_FILE
.
An example could be:
export TS_POST_PROCESS_FILE="/usr/local/bin/prettier --write"
In your situation, you may want to define a script using tools like sed
or similar text processing utilities if you are on a Linux or Unix-based OS, or a custom node.js script to remove certain information. The solution will depend on the specific mechanisms - CLI, Maven, Gradle, etc. - used for generating your code.
It's worth considering whether it is essential to version control a generated file. There might be alternatives where it can be generated and directly utilized by your code, or setting up CI pipelines to produce an npm package that can be utilized in a private registry and then in your projects, if needed.