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

Control link applicability with "hrefRequired" #404

Merged
merged 3 commits into from
Sep 26, 2017

Conversation

handrews
Copy link
Contributor

@handrews handrews commented Sep 13, 2017

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".

@handrews handrews added this to the draft-07 (wright-*-02) milestone Sep 13, 2017
@handrews handrews changed the title Control link applicability with hrefRequired Control link applicability with "hrefRequired" Sep 13, 2017
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo "varibles"

Copy link
Contributor Author

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.

@handrews handrews force-pushed the href-req branch 2 times, most recently from 9fdd8ef to 441fa3d Compare September 14, 2017 06:21
Copy link
Member

@awwright awwright left a 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.
@handrews
Copy link
Contributor Author

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"
}
Copy link
Member

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?

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, good catch, I'll fix that.

@handrews
Copy link
Contributor Author

Last call! This goes in tomorrow barring substantial objections.

@handrews handrews merged commit e4b2e95 into json-schema-org:master Sep 26, 2017
@handrews handrews deleted the href-req branch October 18, 2017 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants