swagger-api / swagger-api/swagger-codegen

CLI option for help/documentation does not work as described

Open
#11,912 0 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Description

Following the README I tried to get documentation for the generate command with:

java -jar swagger-codegen-cli-3.0.35.jar help generate

The output is not the documentation, but this:

usage: swagger-codegen [-h] Command ...

named arguments:
  -h, --help             show this help message and exit

commands:
  Command                additional help
    generate             generate
    config-help          config-help
    meta                 meta
    langs                langs
    version              version
Swagger-codegen version

The latest from Maven Central, 3.0.35.

Swagger declaration file content or url

None

Command line used for generation
java -jar swagger-codegen-cli-3.0.35.jar help generate

Also tried

java -jar swagger-codegen-cli-3.0.35.jar -h generate
java -jar swagger-codegen-cli-3.0.35.jar --help generate

with the same result.

This suggestion:

java -jar swagger-codegen-cli-3.0.35.jar config-help

Crashes the program with:

Exception in thread "Thread-0" java.lang.NullPointerException
        at java.base/java.lang.String.concat(Unknown Source)
        at io.swagger.codegen.v3.CodegenConfigLoader.forName(CodegenConfigLoader.java:31)
        at io.swagger.codegen.v3.cli.cmd.ConfigHelp.run(ConfigHelp.java:17)
        at java.base/java.lang.Thread.run(Unknown Source)
Steps to reproduce

See description above.

Related issues/PRs
Suggest a fix/enhancement

Do not hide the documentation in the command, but include it this repo and link from the README.

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 README command examples and the stack-trace locations in CodegenConfigLoader.java and ConfigHelp.java. Reproduce the documented help and config-help commands, then verify that the CLI returns the expected documentation without crashing.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.