Skip to content
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

Closed
wants to merge 3 commits into from

Conversation

P0lip
Copy link
Contributor

@P0lip P0lip commented Jan 6, 2022

Fixes #1972

Needs #2016

Checklist

  • Tests added / updated
  • Docs added / updated

Does this PR introduce a breaking change?

  • Yes
  • No

@P0lip P0lip added the t/bug Something isn't working label Jan 6, 2022
@P0lip P0lip self-assigned this Jan 6, 2022
@P0lip P0lip added enhancement New feature or request and removed t/bug Something isn't working labels Jan 6, 2022
Base automatically changed from feat/core/multiple-aliases to develop January 19, 2022 00:55
OperationObject: '#PathItem[get,put,post,delete,options,head,patch,trace]',
SchemaObject: ['#MediaTypeObject.schema', '#ParameterObject.schema', '$.components.schemas[*]'],
Copy link

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?

Copy link
Contributor Author

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

"$..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)]'],
Copy link

@hudlow hudlow Feb 1, 2022

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?

Copy link
Contributor Author

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

Copy link

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!

@P0lip P0lip force-pushed the feat/rulesets/aliases-in-oas branch from a2019f1 to db5b847 Compare March 14, 2022 11:44
@P0lip P0lip closed this Apr 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

oas3-valid-schema-example: Issue with properties called "default"?
3 participants