More consistent concept of schema resources #788
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
[EDIT: I am going to do a revision of this attempting to keep the nice "schema resource" concept and facilitate the bundling use case without needing the
$ref
schema value. There are many things about the approach in this PR (788) that I like, but having sorted out more details I may have one more option for comparison.]Fixes #779.
To me, this is essentially part of #780. Where we end up with
here is much more sensible and consistent, with fewer weird caveats.
It acknowledges a use case that I have seen and used often, while
making clear that many "dereferencing" cases, while common and
potentially workable depending on what you're doing, are in fact
likely to break things.
This further clarifies the schema resource concept and
how it is used. In particular, schema resources are
crucial to determining when it is safe to embed a
reference target into its referring schema.
This also requires allowing "$ref" to take a schema value.
The bundling use case should be more clear given this
guidance. While many reference target embedding transformations
are likely to break things and are therefor to be discouraged,
when framed in terms of schema resources a clear use case emerges.
This also relaxes a restriction on "$schema" that has no functional
impact but avoids requiring implementations to detect and handle
a rather complex case (embedding schema resources with different
"$schema" values). And also means that embedding can work without
having to change the embedded value by removing the "$schema"
keyword.