OpenAPITools / OpenAPITools/openapi-generator

[BUG] [HTML] Empty component description

Open
#7,798 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Client: HTML Issue: Bug
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).

image

Expected behaviour

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

image

Related issues/PRs

No data.

Suggest a fix

Re-use the code that renders a field representation.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.