-
-
Notifications
You must be signed in to change notification settings - Fork 248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(rulesets): use aliases in ruleset #2018
Conversation
packages/rulesets/src/oas/index.ts
Outdated
OperationObject: '#PathItem[get,put,post,delete,options,head,patch,trace]', | ||
SchemaObject: ['#MediaTypeObject.schema', '#ParameterObject.schema', '$.components.schemas[*]'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it's not final yet. SchemaObject
will have to catch all schemas, I've got it somewhere but not committed yet
packages/rulesets/src/oas/index.ts
Outdated
"$..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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?