OpenAPITools / OpenAPITools/openapi-generator-cli

[BUG] "Required option '-i' is missing"

Open
#690 21 comments 15 reactions 1 assignee View on GitHub

@kay-schecker is already working on this.

Since Mar 3, 2023.

bug
Dominant language
TypeScript
Stars
2k
Forks
208
Avg merge
7h 12m
Merged PRs (30d)
6

Description

🐛 Bug Report:

Describe the bug

When I run npx openapi-generator-cli generate, I get the following error:

$ npx openapi-generator-cli genera
[error] Required option '-i' is missing
Steps to Reproduce

I'm on v 2.5.2 (latest at time of writing), Cygwin on Windows, Node 14. Here's all relevant info I can think of:

$ npx --version
6.14.17
$ npm --version
6.14.17
$ node --version
v14.20.0
$ npx openapi-generator-cli version
6.0.1
$ grep openapi-generator ../../package.json
    "@openapitools/openapi-generator-cli": "^2.5.2",
$ cat openapitools.json
{
  "$schema": "../../node_modules/@openapitools/openapi-generator-cli/config.schema.json",
  "spaces": 2,
  "generator-cli": {
    "version": "6.0.0",
    "generators": {
      "my-spec-gen": {
        "generatorName": "typescript-rxjs",
        "output": "./generated",
        "inputSpec": "./reference/my-spec.yaml"
      }
    }
  }
}
$ npx openapi-generator-cli generate
Download 6.0.1 ...
Downloaded 6.0.1
[error] Required option '-i' is missing
Expected behavior

openapi-generator-cli should invoke openapi-generator-cli with correct args in order to regenerate my models

Operation System (please complete the following information):
  • OS: Windows 10, Cygwin
Package System (please complete the following information):

npm 6.14.17, node v14.20.0

I get the same on Node 18

Additional context

This appears to be the same issue described in #43 that is marked fixed.

I was able to work around by invoking Java directly:

java -jar ../../node_modules/@openapitools/openapi-generator-cli/versions/6.0.1.jar generate -i ./reference/my-api.yaml -o generated -g typescript-rxjs

I can't see what's up with openapi-generator-cli or how to diagnose further. I wasn't able to get any diagnostic logs, and the main.js seems minified so I couldn't investigate further.

Contributor guide

No contributing guide indexed for this repository

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.