Skip to content

More consistent concept of schema resources #788

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

Closed
wants to merge 1 commit into from

Conversation

handrews
Copy link
Contributor

@handrews handrews commented Aug 24, 2019

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

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

I'm going to take this down in favor of another approach. May revive if that doesn't work.

@handrews handrews closed this Aug 24, 2019
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.

1 participant