spectral: Spectral OAS2 validation throws a non-existent error without path value
Running spectral OAS2 rules and functions sets on a OAS2 .yaml file on all tests (2 different yaml files) results in a cryptic error without a "path" parameter:
{
"name": "oas2-schema",
"summary": "Validate structure of OpenAPIv2 specification.",
"message": "should NOT have additional properties: 0",
"path": [],
"severity": 50,
"severityLabel": "error"
}
Those files don’t throw any errors in any other validation tool (swagger editor, apiary, etc.). I am happy to provide them if needed.
I’m submitting a…
- bug report
- feature request
What is the current behavior?
Running:
spectral.addFunctions(oas2Functions());
spectral.addRules(oas2Rules());
const results = spectral.run(myOAS);
on a OAS2 .yaml file
What is the expected behavior?
Do not throw this error or be more specific on it’s origin and place in the file.
What is the motivation / use case for changing the behavior?
User experience and compliance with OAS2 specification
Please tell us about your environment:
- Version: @stoplight/spectral@1.2.0
- Framework: [ ]
- Language: [all]
Other information
It also throws
oasOpParams expects a resolved object, but none was provided. Results may not be correct.
oasPathParam expects a resolved object, but none was provided. Results may not be correct.
which does not say anything of value without more explanation.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 17 (11 by maintainers)
Commits related to this issue
- test(operation-2xx-response): trying to confirm if this rule works Struggling to figure out if this rule actually works or not, and tests are giving a warning.ç re #109 — committed to stoplightio/spectral by deleted user 5 years ago
- test(operation-2xx-response): trying to confirm if this rule works Struggling to figure out if this rule actually works or not, and tests are giving a warning.ç re #109 — committed to stoplightio/spectral by deleted user 5 years ago
- OAS : Ignore anything at PathItem level which is not HTTP verb (#111) * test(operation-2xx-response): trying to confirm if this rule works Struggling to figure out if this rule actually works or n... — committed to stoplightio/spectral by deleted user 5 years ago
- OAS : Ignore anything at PathItem level which is not HTTP verb (#111) * test(operation-2xx-response): trying to confirm if this rule works Struggling to figure out if this rule actually works or n... — committed to stoplightio/spectral by deleted user 5 years ago
@jerzyn I found the cause of the issue for
x-summaryfield. Posted the explanation here https://github.com/stoplightio/spectral/pull/111#issuecomment-477138102