Skip to content

Core: Restrict usage of $schema some #248

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

Merged
merged 1 commit into from
Feb 15, 2017

Conversation

awwright
Copy link
Member

@awwright awwright commented Feb 5, 2017

PR for Issue #244

Copy link
Contributor

@handrews handrews left a comment

Choose a reason for hiding this comment

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

I'd like to give @Relequestual a chance to weigh in since he had not had a chance to comment on this final approach on the issue yet, but this looks good to me.

@seagreen
Copy link
Collaborator

seagreen commented Feb 6, 2017

Please ignore this if it's not helpful, I'm going to keep being a contrarian...

I don't believe in self-describing data like $schema. I think this information is better kept outside of the document itself.

To explain why, say you have a schema that's valid against draft 12. Then draft 13 comes out. Draft 13 has only very small changes, and you're schema is valid when used with both 12 and 13.

If the schema doesn't declare what draft it uses, then it can be referenced in the context of draft 12 and draft 13 validation perfectly fine. So what was gained by declaring "$schema": "draft12" in the first place? It would be like a piece of JSON data declaring exactly which JSON Schema document it matches -- this wouldn't be a good idea because there might be many different JSON Schema documents used to validate that instance over its lifetime of use.

So I think this should read: The root schema of a JSON Schema document MAY use this keyword.

@awwright
Copy link
Member Author

awwright commented Feb 7, 2017

@seagreen This is perhaps a better discussion for a new Issue, however;

$schema has the same effect as declaring usage of a profile or media type, it is not merely asserting restrictions that the document must follow, it is also declaring which behaviors those keywords will have. #151 seems slightly relevant to this.

If a simple document can be described under two profiles (meta-schemas), then... it can be described under two profiles, and I don't really see how that's a bad thing.

I can see some arguments that this solution doesn't need to rise to the level of being self-describing, but that's different from saying that's a negative property of a system. (And it very may well be a negative property, to be sure, look at Gödel's incompleteness theorem.)

Why the downgrade from SHOULD to MAY?

@handrews
Copy link
Contributor

handrews commented Feb 8, 2017

@seagreen I have a number of concerns around $schema and how we indicate vocabularies, extension vocabularies, and versions of those things. But that's a big discussion. Can we please go forward with this for Draft 06? I don't recall seeing any complaint about this in any issue in either repo up until now, which suggests to me that this is not worth dragging out the next draft for.

I would love to track all of the ideas and concerns as their own separate issues which we can discuss for future drafts. But revamping the entire versioning approach is not going to happen in the next week or so.

@seagreen
Copy link
Collaborator

seagreen commented Feb 8, 2017

@handrews: Absolutely go ahead! Thanks for asking, you obviously didn't have to. Once you reassured me that these are actual drafts and not meant to be in prod for years like Draft 4 my concerns went away.

@awwright: Sorry I'm taking my time to get back to you, I'm really looking forward to thinking about #151 in depth, but haven't had the time yet. Once I do I'll open an actual issue for my concerns with $schema, so as far as I'm concerned this PR is good to go.

@handrews handrews added this to the draft-next (draft-6) milestone Feb 9, 2017
@awwright awwright merged commit c98a9d4 into json-schema-org:master Feb 15, 2017
@awwright awwright deleted the issue-244-schema branch February 16, 2017 22:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants