OpenAPITools / OpenAPITools/openapi-generator

[BUG] Web pages do not list libraries of generators

Open
#11,993 4 comments 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

Bug Report Checklist
  • Have you provided a full/minimal spec to reproduce the issue?
  • [n/a] 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?
  • [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description

Several generators have libraries within them which broaden the platforms which the generator supports.

But the automatically-generated web pages (e.g., https://openapi-generator.tech/docs/generators) do not list the libraries derived from the generators which are listed.

Related issues/PRs

None found

Suggest a fix

Small changes to src/main/java/org/openapitools/codegen/cmd/ListGenerators.java would probably take care of this. The appendForType method which already iterates through the known generators could also iterate through each generator's supportedLibraries() (if any) and extract the name and/or description of each library and add it to the output.

For example, this change would take care of the else half of the if-then-else near the end of the method:

--- a/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/ListGenerators.java
+++ b/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/ListGenerators.java
@@ -119,6 +119,10 @@ public class ListGenerators extends OpenApiGeneratorCommand {
                     if (meta != null && meta.getStability() != null && meta.getStability() != Stability.STABLE) {
                         sb.append(" (").append(meta.getStability().value()).append(")");
                     }
+                    generator.supportedLibraries().forEach((name, desc) ->
+                                                                   sb.append(System.lineSeparator())
+                                                                           .append("      - ")
+                                                                           .append(name));
                 }
                 sb.append(System.lineSeparator());
             });

There would need to be a change to the if part as well.

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 in modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/ListGenerators.java, focusing on appendForType and its handling of known generators. Review how supportedLibraries() is exposed and how the generated generator pages consume this output. Done means the automatically generated web pages list each generator's libraries, including both branches of the existing conditional.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, openapi
Domain
cli, 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.