Skip to content

[CLI] Fix help command#1279

Merged
wing328 merged 2 commits intoOpenAPITools:masterfrom
ackintosh:fix-help-command
Oct 20, 2018
Merged

[CLI] Fix help command#1279
wing328 merged 2 commits intoOpenAPITools:masterfrom
ackintosh:fix-help-command

Conversation

@ackintosh
Copy link
Copy Markdown
Contributor

@ackintosh ackintosh commented Oct 20, 2018

PR checklist

  • Read the contribution guidelines.
  • Ran the shell script under ./bin/ to update Petstore sample so that CIs can verify the change. (For instance, only need to run ./bin/{LANG}-petstore.sh and ./bin/security/{LANG}-petstore.sh if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in .\bin\windows\.
  • Filed the PR against the correct branch: master, 3.4.x, 4.0.x. Default: master.
  • Copied the technical committee to review the pull request if your PR is targeting a particular programming language.

Description of the PR

This PR fixes #1278 .


Since guava 21, firstNonNull is removed but airline 0.7 still using that. so the following error is caused by run java -jar openapi-generator-cli.jar help.

Exception in thread "main" java.lang.NoSuchMethodError: com.google.common.base.Objects.firstNonNull(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
	at io.airlift.airline.GlobalUsageSummary$2.apply(GlobalUsageSummary.java:100)
	at io.airlift.airline.GlobalUsageSummary$2.apply(GlobalUsageSummary.java:97)
	at com.google.common.collect.Iterators$6.transform(Iterators.java:785)
	at com.google.common.collect.TransformedIterator.next(TransformedIterator.java:47)
	at io.airlift.airline.UsagePrinter.appendTable(UsagePrinter.java:57)
	at io.airlift.airline.GlobalUsageSummary.usage(GlobalUsageSummary.java:96)
	at io.airlift.airline.GlobalUsageSummary.usage(GlobalUsageSummary.java:52)
	at io.airlift.airline.Help.help(Help.java:57)
	at io.airlift.airline.Help.help(Help.java:50)
	at io.airlift.airline.Help.run(Help.java:25)
	at org.openapitools.codegen.OpenAPIGenerator.main(OpenAPIGenerator.java:62)

@ackintosh ackintosh added this to the 3.3.2 milestone Oct 20, 2018
@ackintosh ackintosh changed the title Fix help command [CLI] Fix help command Oct 20, 2018
@ackintosh
Copy link
Copy Markdown
Contributor Author

cc @OpenAPITools/generator-core-team

@wing328
Copy link
Copy Markdown
Member

wing328 commented Oct 20, 2018

@ackintosh thanks for the quick fix, which works for me:

➜  graphql-generator git:(ackintosh-fix-help-command) ✗ java -jar "./modules/openapi-generator-cli/target/openapi-generator-cli.jar" help
usage: openapi-generator-cli <command> [<args>]

The most commonly used openapi-generator-cli commands are:
    config-help   Config help for chosen lang
    generate      Generate code with the specified generator.
    help          Display help information
    langs         Shows available languages (deprecated. use 'list' instead)
    list          Lists the available generators
    meta          MetaGenerator. Generator for creating a new template set and configuration for Codegen.  The output will be based on the language you specify, and includes default templates to include.
    validate      Validate specification
    version       Show version information

See 'openapi-generator-cli help <command>' for more information on a specific
command.

@wing328 wing328 merged commit 27fd224 into OpenAPITools:master Oct 20, 2018
A-Joshi pushed a commit to ihsmarkitoss/openapi-generator that referenced this pull request Feb 27, 2019
* Bump up airline

* Since airline 0.8, "ParserUtil.createInstance" requires CommandFactory
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NullPointerException with command line interface and command help

2 participants