Skip to content
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

Invalid path error when --project option is missing #3

Open
wespen opened this issue Jul 14, 2020 · 2 comments
Open

Invalid path error when --project option is missing #3

wespen opened this issue Jul 14, 2020 · 2 comments

Comments

@wespen
Copy link

wespen commented Jul 14, 2020

When you try to call CLI without the -p parm like
npx apidoc-openapi --src ./src/api/ --out ./docs/api.json

you get back
The "path" argument must be of type string. Received undefined

The problem is in line 44 with path.resolve
apidoc: path.resolve(cwd, program.project)

Stack:

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
    at validateString (internal/validators.js:121:11)
    at Object.resolve (path.js:980:7)
    at Object.main (/node_modules/@forfuture/apidoc-openapi/src/index.js:44:18)

Let me know if you would accept the pull request.

@GochoMugo
Copy link
Member

It surely is not clear that the parameter is required.

What changes do you suggest?

@wespen
Copy link
Author

wespen commented Jul 14, 2020

Handle it as optional and skip path resolving.
apidoc is in if case later in the code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants