-
Notifications
You must be signed in to change notification settings - Fork 80
Closed
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomers
Description
Detailed description
The latest 0.8.6 version fails to print proper advice on invalid specs:
> speccy lint swagger.json
./node_modules/speccy/lint.js:83
const { context, lintResults } = _options;
^
TypeError: Cannot destructure property `context` of 'undefined' or 'null'.
at validator.validate (./node_modules/speccy/lint.js:83:42)
at ./node_modules/call-me-maybe/index.js:13:28
at process._tickCallback (internal/process/next_tick.js:61:11)
whereas version 0.8.5 properly hints at the underlying issue:
> speccy lint swagger.json
Specification schema is invalid.
#/paths/~1api<hidden>/post/parameters/0
path parameters must appear in the path
Context
I'm working on linting both v2 (using swagger2openapi) and v3 files from an older project. Some of the existing v2 files had not been linted before, and seems they are not even spec compliant.
The nodejs exception does not help finding out where the error actually lies, it looks to a user as if speccy is having an issue, instead of parsing an invalid spec.
Your environment
- Node Version: Both latest v8 & v10 via nvm
- Operating system and version: Debian 9.6
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomers