Closed philsturgeon closed 1 year ago
I think it's because you also list OperationObject
in the DescribableObjects
alias, and in the example input above you do have a get operation, that does not have any description
, so you'd need to add one or remove OperationObject
from the alias you use.
{
name: "valid operation level parameters",
document: {
swagger: "2.0",
paths: {
"/todos": {
get: {
description: 'should be present here too since we look for it',
parameters: [
{
name: "limit",
in: "query",
description: "This is how it works.",
type: "integer",
},
],
},
},
},
},
errors: [],
},
Thank you! Proper silly of me to not notice that, but its one of the first rules that does that many things. Passing now!
Unexpected error coming out of docs-description for parameter arrays.
Context
In a pull request (https://github.com/stoplightio/spectral-documentation/pull/4) I'm bringing over parameter description tests from the core oas ruleset, and they're failing in my ruleset. Tried a bunch of things but I think something special is happening that might need the insight the core team.
Current Behavior
This test for
docs-description
should be valid:The unexpected error is:
What is a get.description? It's meant to be get.parameters[0].decription its looking at.
The JSONPath in the ruleset shows the object is being found properly:
So I can only assume something funny is happening in nimma or elsewhere in Spectral?
Expected Behavior
I expect the above test to pass.
Grab the
parameter-descriptions
branch (#4) and runnpm test
.