OpenAPITools / OpenAPITools/openapi-generator
[BUG] Global properties configuration for batch command
@jimschubert is already working on this.
Since Oct 3, 2020.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Bug Report Checklist
- Have you provided a full/minimal spec to reproduce the issue?
- Have you validated the input using an OpenAPI validator (example)?
- Have you tested with the latest master to confirm the issue still exists?
- Have you searched for related issues/PRs?
- What's the actual output vs expected output?
- [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description
There doesn't appear to be any documentation on how to specify the global properties when using the batch command.
This command will work since it uses -D:
java -Dmodels -DmodelTests=false -DsupportingFiles -Dapis=Pets -jar openapi-generator-cli.jar batch --root-dir=dist --fail-fast -v -- *.yaml
However it would be ideal to set those properties in the YAML (or JSON) files.
openapi-generator version
4.3.1
OpenAPI declaration file content or url
Generation Details
java -Dmodels -DmodelTests=false -DsupportingFiles -Dapis=Pets -jar openapi-generator-cli.jar batch --root-dir=dist --fail-fast -v -- *.yaml
Steps to reproduce
Set the globalProperty or globalProperties key of the config YAML file and run the batch command:
java -jar openapi-generator-cli.jar batch --root-dir=dist --fail-fast -v -- *.yaml
It does not take into account the options. I have tried comma-separated value, array, and object with keys models, apis, modelTests, etc. All of the models, APIs, and tests are generated.
Related issues/PRs
N/A
Suggest a fix
The batch command should take into account a globalProperties key in the configuration files, similar to additionalProperties, and this should be documented.
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.
Assessment
This issue has not been assessed yet.