OpenAPITools / OpenAPITools/openapi-generator

[BUG] html2 generator: documentation for schemas is missing

Open
#18,487 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Issue: Bug
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

Description

openapi-generator-maven-plugin fails to include documentation for schemas in the generated HTML documentation, despite configuring the plugin to do so.

openapi-generator version

7.5.0

plugin configuration
 <plugin>
          <groupId>org.openapitools</groupId>
          <artifactId>openapi-generator-maven-plugin</artifactId>
          <version>7.5.0</version>
          <executions>
              <execution>
                  <id>generate-html-docs</id>
                  <goals>
                      <goal>generate</goal>
                  </goals>
                  <configuration>
                      <inputSpec>${project.basedir}/spec.json</inputSpec>
                      <generatorName>html2</generatorName>
                      <output>${project.build.directory}/docs</output>
                      <generateModelDocumentation>true</generateModelDocumentation>
                  </configuration>
              </execution>
          </executions>
 </plugin>
OpenAPI declaration file content (spec.json)

{
  "openapi": "3.0.0",
  "info": {
    "title": "Sample contract",
    "version": "1.0.0"
  },
  "paths": {},
  "components": {
    "schemas": {
      "Request": {
        "type": "object",
        "required": ["token"],
        "properties": {
          "token": {
            "type": "string"
          }
        }
      }
    }
  }
}

Steps to reproduce
  1. Use OpenApi spec provided
  2. Generate html documentation: mvn clean package
Generated docs

Screenshot 2024-04-24 at 16 12 46

Expected behaviour

The html2 generator of openapi-generator-maven-plugin should incorporate documentation for schemas within the resulting HTML documentation.

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 with the Maven plugin configuration and spec.json example in the issue, then run mvn clean package using the html2 generator. Inspect the generated HTML documentation for the Request schema and verify that schema documentation is included as expected.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, openapi
Domain
documentation, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.