-
-
Notifications
You must be signed in to change notification settings - Fork 314
Fix recursion in hyper-schema.json #397
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
Conversation
Fix recursion to include `contains` (specifically mentioned in section 3.1 of the hyper-schema spec), and `propertyNames` (probably irrelevant, since none of the hyper-schema fields would apply) Much more concise definition of recursion. Probably *too* concise.
Perhaps the recursion is a little too concise and the regexes should be expanded a bit from, eg, Or perhaps the original verbose form is clearest and only needs |
@levbishop thanks for submitting a PR! It's great to see a new name in the PR list.
Yes, I think this is preferred. Many people use the meta-schemas as shorthand documentation. It's debatable as to how wise that is, but using patternProperties here is more than a little off-putting. I rarely see it used at all across several large projects, and not everyone is comfortable with regexes. While this PR is fine (especially since you are clearly open to re-working it), most of the time it's better to file an issue first until you've been through a draft cycle and have a feel for how things land with various team members. But definitely no need for that here, if you change this to just at contains and propertyNames I'll be happy to merge it (I'm going to double check and see if there's a reason they were left out, but I'm pretty sure it was an accident) |
Go back to the much less concise, but more readable, specification of the recursion.
fix whitespace issues
Reworked to verbose format for recursion (still slightly simplified relative to original). |
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.
Thanks, this is great! Good catch removing the no-longer-needed anyOf
s as well.
contains
(specifically mentioned in section 3.1 of the hyper-schema spec), andpropertyNames
(probably irrelevant, since none of the hyper-schema fields would apply, but feels like a better practise since the core spec refers to the hyper-schema definition for guidance on recursion when extending schemas (see also spec: remove/change extending meta-schemas recommendation #86))