-
-
Notifications
You must be signed in to change notification settings - Fork 154
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
openapitools.json + generate error: requires option '-i' #43
Comments
I guess it's an issue with the current cwd. I'll fix it asap |
which OS, Node and NPM you are using? |
edit: running npm with |
fixed with v2.0.3 |
The error still appears with version 2.0.3. At least for me. Minimal example (tested on macOS, arch linux and windows):
|
Thanks, I'll check |
You missed the generators node: {
"$schema": "node_modules/@openapitools/openapi-generator-cli/config.schema.json",
"spaces": 2,
"generator-cli": {
"version": "5.0.0-beta2",
"generators": {
"project-ts": {
"generatorName": "typescript-axios",
"output": "#{cwd}/src/api/#{name}",
"glob": ".apiSchema/swagger/*.json"
}
}
}
} |
I'll add a new feature to validate the given config ... |
Yes, sorry I should have noticed. |
I still get this error on the latest version. Is there a workaround? I can't even figure out how to get this tool to print what Java command it is invoking so I can work around. 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:
Any ideas what I can do to diagnose or fix? |
I was able to work around by invoking Java directly:
.. still not sure what's up with |
We have the same issue with pnpm --dir <path to the projects root folder> run generate-sources
"generate-sources": "openapi-generator-cli generate" The generation of types runs as part of the CI on windows, mac and linux. It only fails on windows. Furthermore it didn't cause any problems when used in conjunction with |
Found the issue! 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. |
Running
openapi-generator-cli generate
without additional parameter is not working:[error] Required option '-i' is missing
openapitools.json:
package.json (excerpt):
npm run generate:openapi
in project root.apiSchema/swagger
2.0.2
The text was updated successfully, but these errors were encountered: