OpenAPITools / OpenAPITools/openapi-generator
[BUG][Cpp-UE4] Missing feature for generating docs
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?
Description
There is no available option to be able to use "Readme.mustace", "api_doc.mustache" and "model_doc.mustache" template files in cpp-ue4.
My suggestion is to introduce an optional property to the generating call: generateReadme = true, which by default will be false, so won't be a breaking change. If this property is enabled, your templates can use the Readme template file and generate an "index.md". The "index" name was chosen so that mkdocs can be used including multiple services generated via OpenAPI and this way can create a page for each of them and use the mkdocs index section feature.
For "api_doc" and "model_doc" there are already the global properties: apiDocs and modelDocs. My suggestion is to use them and only update CppUE4ClientCodegen to add the mustache templates into modelDocTemplateFiles and apiDocTemplateFiles structures as it's done with other languages.
openapi-generator version
I am using the latest version - master.
Generation Details
java -ea -server -Duser.timezone=UTC -jar openapi-generator-cli.jar generate -o /MyOutDis/ -i /MySpecsFile.yml -t /MyTemplateDir/ -g cpp-ue4 --global-property apiDocs=true --global-property modelDocs=true -p generateReadme=true
Steps to reproduce
1, Make these files ("Readme.mustace", "api_doc.mustache" and "model_doc.mustache") in your template directory
2. Generate using OpenAPI with cpp-ue4 language and enable the apiDocs and modelDocs options.
3. Note that no md files were generated
Suggest a fix
I opened a PR with the suggested solution: https://github.com/OpenAPITools/openapi-generator/pull/17762
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 CppUE4ClientCodegen and compare its template-file handling with the cpp-ue4 generation command and the Readme.mustache, api_doc.mustache, and model_doc.mustache files described here. Review PR #17762 and verify completion by generating with apiDocs, modelDocs, and generateReadme enabled and confirming the expected Markdown files are produced.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, openapi, unreal-engine
- Domain
- documentation, tooling
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 25/100