OpenAPITools / OpenAPITools/openapi-generator
[BUG] Web pages do not list libraries of generators
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?
- [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
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 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