OpenAPITools / OpenAPITools/openapi-generator
[BUG][HTML] Parameter names garbled in generated documentation, '-' is replaced with 'Minus'
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Description
Parameter names are garbled in html output, - is replaced with Minus in parameter names.
openapi-generator version
5.3.1
OpenAPI declaration file content or url
See modified petstore.yaml gist
Generation Details / Steps to Reproduce
curl https://gist.githubusercontent.com/lpar/4af360f8a2c94d2a31c6e12062f2812c/raw/1a11fd965c099669677f3b79c4eecbb73e4f34b8/petstore2.yaml > petstore2.yaml
mkdir petstore
npx openapi-generator-cli version-manager set 5.3.1
npx openapi-generator-cli generate -i petstore2.yaml -g html -o petstore
grep Minus petstore/index.html
Related issues/PRs
Somewhat related to #6465, which is a similar problem in html2 affecting HTTP headers.
Suggest a fix
I'm guessing that the templates for html are using a variable which contains a parameter name that has been sanitized for code generation. Presumably html2 uses the correct variable name (at least for parameters), as it doesn't have the same bug.
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 by reproducing the issue with the linked petstore2.yaml and the documented html generation commands, then inspect the html templates that render parameter names. Compare the parameter variable used by html with the behavior of html2, as suggested in the report. Done means generated HTML preserves '-' in parameter names instead of rendering it as 'Minus'; verify with grep on petstore/index.html.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- html, java, openapi
- Domain
- api, documentation
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100