-
-
Notifications
You must be signed in to change notification settings - Fork 156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] "Required option '-i' is missing" #690
Comments
I can confirm the bug, after a fresh install of Installing it globally and using only the command line options worked for me (as a workaround) |
I had the same issue while trying to run After invoking the generator via a NPM script from my
via |
To get the issue back on track: The problem is not that "-i is missing", but that the Im pretty sure of this, because when i specify -i manually the cmd complains about generator name as so on.. even tho they are all defined in the json. |
This seems to have been fixed in the latest version. |
thanks for the confirmation just so you know we just released openapi-generator v7.3.0 |
Experiencing this as well. Only on Windows. |
@wing328 it's not fixed in 7.3.0, just tried that out. |
Can confirm it still happens on 7.4.0 |
are you guys using Windows? are you using DOS prompt? it works for me on Windows 11, JDK17 with DOS command prompt. |
Running both Windows 11 and JDK17. Can reproduce in conhost too, but I mainly use pwsh in Windows Terminal. That doesn't seem to be the issue. I'm probably in a wrong issue though, my issue is mainly related to this issue: #43. I'm using pnpm and I'm calling the generator from a package.json script. |
Found the issue. At least in my case. Openapi-generator-cli is using INIT_CWD as its working directory:
When I ran my pnpm test script from a different directory (
There's an issue in pnpm discussing where INIT_CWD is supposed to point. |
thanks for sharing the details. as a workaround, please use npm instead. |
Hi @wing328 using npm (assuming below is what you meant) does not work. I tried the following,
And then ran,
Still same error,
Edit: Using version 7.4.0 on Ubuntu 22.04 |
the latest version of the npm wrapper allows you to specify the openapitools.json file. can you please give it a try? |
Hi @wing328 thanks for the follow up. After much debugging I discovered that the same error is given if the Its now working as expected on the latest release. |
Hello @wing328,
I'm using npm to run "openapi-generator-cli generate" command
I found this comment #758 (comment), and I believe it could solve my situation. Has a workaround I have to define all the configurations like this |
I think openapi-generator-cli should really just use |
🐛 Bug Report:
Describe the bug
When I run
npx openapi-generator-cli generate
, I get the following error: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:
Expected behavior
openapi-generator-cli
should invokeopenapi-generator-cli
with correct args in order to regenerate my modelsOperation System (please complete the following information):
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:
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.
The text was updated successfully, but these errors were encountered: