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

Clarify how to use "contentSchema" #1352

Merged
merged 1 commit into from
Dec 6, 2022
Merged

Conversation

handrews
Copy link
Contributor

@handrews handrews commented Nov 21, 2022

[note: The fix is shorter than this description]

The value of "contentSchema" is a normal subschema, and using it out of context can fail in ways schema users are unlikely to automatically consider. Since "contentSchema" has to be applied separately from the evaluation process in which it was collected as an annotation, it is schema authors and users (rather than implementers) who need to be aware of this. In particular, users need to know the safe way to access the schema.

We know that many schema users find base URIs/IRIs confusing, and that the behavior of implementations in the absence of "$schema" is inconsistent. Without delving into those topics (which are addressed in core, or in RFC 3986), this clarification shows how to use "contentSchema" as a normal subschema from an annotation.

It also explains the circumstances under which the extracted annotation value is safe to use. The language attempts to balance the likelihood that readers will not be familiar enough with the restrictions to note this on their own with the desire to minimize re-stating schema processing rules documented in the core specification. This should be enough to encourage readers to check the relevant core specification sections.

We know that many schema users find base URIs/IRIs confusing, and
that the behavior of implementations in the absence of "$schema"
is inconsistent.  Without delving into those topics (which are
addressed in core, or in RFC 3986), this clarification shows how
to use "contentSchema" as a normal subschema from an annotation.

It also explains the circumstances under which the extracted
annotation value is safe to use.  The language attempts to balance
the likelihood that readers will not be familiar enough with
the restrictions to note this on their own with the desire to
minimize re-stating schema processing rules documented in the core
specification.  This should be enough to encourage readers to
check the relevant core specification sections.
@handrews handrews added this to the draft-next milestone Nov 21, 2022
@handrews handrews marked this pull request as ready for review November 21, 2022 21:29
@handrews handrews merged commit 5b995c1 into json-schema-org:main Dec 6, 2022
@handrews handrews deleted the contents branch January 18, 2023 20:29
@gregsdennis gregsdennis added clarification Items that need to be clarified in the specification and removed Type: Maintenance labels Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clarification Items that need to be clarified in the specification
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Should "contentSchema" have schema location behavior? Clarify the handling of "contentSchema"
3 participants