feat(rulesets): use aliases in ruleset#2018
Conversation
| }, | ||
| RequestBodyObject: ['#OperationObject.requestBody', '$.components.requestBodies[*]'], | ||
| OperationObject: '#PathItem[get,put,post,delete,options,head,patch,trace]', | ||
| SchemaObject: ['#MediaTypeObject.schema', '#ParameterObject.schema', '$.components.schemas[*]'], |
There was a problem hiding this comment.
Isn't this a little misleading? I mean, isn't there a possibility of a lot of schema objects embedded in properties (and embedded in properties of properties, and so on) that won't be captured here?
There was a problem hiding this comment.
Yeah, it's not final yet. SchemaObject will have to catch all schemas, I've got it somewhere but not committed yet
| "$..headers..[?(@property !== 'properties' && @ && (@ && @.example !== void 0 || @.default !== void 0) && (@.enum || @.type || @.format || @.$ref || @.properties || @.items))]", | ||
| "$..parameters..[?(@property !== 'properties' && @ && (@ && @.example !== void 0 || @.default !== void 0) && (@.enum || @.type || @.format || @.$ref || @.properties || @.items))]", | ||
| ], | ||
| given: ['#SchemaObject', '#SchemaObject..[?(@ && @.example)]'], |
There was a problem hiding this comment.
Won't this capture components.schema.MySchema.properties if there's a property called example? Or maybe I'm missing something?
There was a problem hiding this comment.
It will, although the current impl does it as well.
In any case, before I mark that PR as ready to review, I'll need to figure out a way to do it. It's not that trivial using JSONPath expressions.,so I'll probably need to think of something else
There was a problem hiding this comment.
Apologies, I totally missed that this was a draft!
a2019f1 to
db5b847
Compare
Fixes #1972
Needs #2016
Checklist
Does this PR introduce a breaking change?