spectral
spectral copied to clipboard
Spectral Crash when "path" is defined as an in parameter
Describe the bug
Linting the above open api with the parameter of in type path causes the linting to error, If I change it to query its fine
example.yaml
openapi: 3.0.1
servers:
- url: 'https://test.co.uk'
paths:
/users/{userId}:
get:
summary: Get a user by ID
parameters:
- in: path
name: userId
schema:
type: integer
required: true
description: Numeric ID of the user to get
To Reproduce
- spectral lint .\example.yaml --verbose
Error #1: Cannot read property 'name' of null
at name == 'api-versio… …js/core/index.js:66 _rollupPluginBabelH…
at eval …js/core/index.js:66 _rollupPluginBabelH…
at _traverseBody …time/traverse.js:13 cb(scope);
at _traverse …time/traverse.js:41 _traverseBody(key, …
at _traverseBody …time/traverse.js:17 _traverse(value, sc…
Expected behavior linting results
Environment (remove any that are not applicable):
- Library version: 6.5.1
- OS: Windows 10
Additional context running node
Hey @UniperMaster! What's your ruleset?
Hey @P0lip, I ran it without a ruleset the standard spectral:oas
Did you install it via npm or did you download the binary?
If it's npm/yarn, try upgrading the rulesets package, yarn upgrade @stoplight/spectral-rulesets
.
I cannot reproduce that issue locally, and I remind myself fixing a similar issue, so my bet is you may be running on an older version of the oas ruleset.
Thanks that worked, please close