OpenAPITools / OpenAPITools/openapi-generator
[BUG] templateOutputDirs config option is ignored
Nobody has claimed this yet.
- 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
I wanted to use different folders for saving my api and model documentation to. I saw that this was implemented here https://github.com/OpenAPITools/openapi-generator/pull/15561/files. When I include config below the template files still get saved in the same directory as before.
templateDir: ./sdk-resources/resources
packageName: Package
packageVersion: 1.2.3
apiVersion: v3
companyName: Company Name
packageGuid: a14925fb-44fb-447d-8708-6fbdf2762efa
commonVerbs: Delete=Remove:Cancel=Suspend:Patch=Update:List=Get:Query=Search:Run=Start:Validate=Confirm:Make=Select
discardReadOnly: true
templateOutputDirs:
api_doc.mustache: ./methods
model_doc.mustache: ./models
I would expect all api documentation to be in a root folder methods and model documentation to be in a root folder models
openapi-generator 7.1.0
OpenAPI declaration file content or url
N/A
Generation Details
java -jar openapi-generator-cli.jar generate -i api-specs/v3.yaml -g powershell -o v3 --global-property skipFormModel=false --config sdk-resources/v3-config.yaml
Steps to reproduce
- Run the generator with templateOutputDirs key specified in the config.yaml
- The particular generator I am using is powershell
Related issues/PRs
https://github.com/OpenAPITools/openapi-generator/pull/15561/files
Suggest a fix
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 sdk-resources/v3-config.yaml and the CLI generation command using api-specs/v3.yaml and the powershell generator; compare the templateOutputDirs behavior with the implementation introduced in PR 15561. Done means API documentation is generated under methods and model documentation under models instead of the previous shared directory.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, powershell
- Domain
- api, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100