OpenAPITools / OpenAPITools/openapi-generator
[BUG] [HTML] Empty component description
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?
- Sponsorship to speed up the bug fix: no.
Description
The generator renders incomplete component representation in some cases (see below).
openapi-generator version
5.0.0-beta2 through Docker image openapitools/openapi-generator-cli:v5.0.0-beta2
OpenAPI declaration file content or url
https://gist.github.com/greatvovan/0ce0b4f72b2319b1a8e1b753ac164b0d
Generation Details
generate -i /local/doc/empty-component.yaml -g html -o /local/doc/openapi-generator/html
Steps to reproduce
Just generate using the specification and command above and open index.html in the browser.
You will see that Response has two fields that are essentially identical, but one of them is described in-place, while another is referred as Color component. The reasoning behind using a reference is a situation when you use a component in multiple places.
Current behaviour
Only description is rendered (nothing if no description).

Expected behaviour
Rendering identical to in-place definition (like for bottomColor field).

Related issues/PRs
No data.
Suggest a fix
Re-use the code that renders a field representation.
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 downloading the linked OpenAPI declaration and running the documented Docker generation command, then inspect the generated index.html. Compare the referenced Color component with the inline bottomColor field and trace the HTML generator's field-rendering path. Done means referenced components render the same representation as equivalent inline definitions, including when no description is present.
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
- 48/100