-
-
Notifications
You must be signed in to change notification settings - Fork 307
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
Control link applicability with "hrefRequired" #404
Conversation
jsonschema-hyperschema.xml
Outdated
but no such data was provided (or "hrefSchema" is not present), and the | ||
instance is an array or a string. | ||
Sometimes, the appropriate values will not be available. In many | ||
cases, the URI Template behavior of simply removing varibles that |
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.
typo "varibles"
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.
I swear I actually do use a spell checker. But so many technical words don't count as spelled right I sometimes miss real errors.
9fdd8ef
to
441fa3d
Compare
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.
This looks like a good solution.
This addresses issue json-schema-org#49. Add a keyword, "hrefRequired", that prevents a link from being used if a variable named in that keyword's array cannot be resolved to a value by any available mechanism. Remove outdated language about non-object instances causing problems, as this is addressed by "hrefPointers".
Properly specify the meta-schema, which for some reason was only a description. We don't put descriptions in the meta-schema anymore, but we do put type information. Not sure what happened there.
Note: The update to the PR after awwright and dlax's approvals is just a rebase onto master so that the PR is no longer stacked on an older PR. There were no changes to the contents of the commits. |
links.json
Outdated
"type": "array", | ||
"items": { | ||
"type": "string" | ||
} |
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.
We could have a "uniqueItems": true
here I guess?
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, good catch, I'll fix that.
Last call! This goes in tomorrow barring substantial objections. |
EDIT: This PR has been rebased so that it only contains the new commits. Originally it was posted piggybacking on #386, which has since been accepted.
This addresses issue #49.
Add a keyword, "hrefRequired", that prevents a link from being
used if a variable named in that keyword's array cannot be resolved
to a value by any available mechanism.
Remove outdated language about non-object instances causing problems,
as this is addressed by "hrefPointers".