Skip to content
This repository has been archived by the owner on Nov 2, 2023. It is now read-only.

Draft 05 meta-schemas #57

Closed
wants to merge 6 commits into from
Closed

Conversation

handrews
Copy link
Contributor

@Relequestual Here is the meta-schema PR that we discussed this morning (for me) / last night (for you).

This collects a lot of cleanup and updates for draft-05's meta-schema in a series of commits for easier review.

The first commit just copies the draft-04 files with no changes.

The remaining commit (except for the last) make bugfixes and feature changes in several steps for easy-to-read diffs. I'm not 100% sure about removing the empty fragment on "$schema" and "id" and the corresponding references, but as best I can tell from reviewing RFC 3986, an absolute URI must not have a fragment, and and empty fragment cannot be normalized away. So I think this is correct.

The final commit copies the completed draft-05 meta-schemas to the top level directory and bumps the number in the documentation. The documentation reference the top level directory URIs for the meta-schemas rather than the numbered URIs, so I left them as-is.

To make the changes easier to track in the version control
history, these are the unmodified Draft 04 meta-schemas.
@handrews
Copy link
Contributor Author

@Relequestual I just updated the last three commits because I had left off the hyper-schema meta-schema's "links" field. Otherwise it is unchanged (except deleting spaces from an otherwise blank line).

@Relequestual
Copy link
Member

Hopefully fixes #51

@awwright
Copy link
Member

We haven't actually anointed a draft-05 meta-schema yet, so where is this getting pulled from?

@Relequestual
Copy link
Member

@awwright I spoke to @handrews on irc about a meta-schema. He said he had already done it, and it was ready, and you shot it down previously, saying we didn't need one for draft-5. I maintain we do for the website.

Regardless, your review of this is welcome. I'll be reviewing it based on the changelog for draft-5. It IS a Pull Request, for review. (An example of why PRs are better than just commiting to master ;) )

@handrews
Copy link
Contributor Author

We haven't actually anointed a draft-05 meta-schema yet

I don't even know what this means. Writing the meta-schema isn't hard and doesn't take mystical cleric powers or anything. I just made the meta-schema changes required by the spec changes.

@handrews
Copy link
Contributor Author

handrews commented Dec 1, 2016

@Relequestual based on IRC discussion with @awwright I need to make some adjustments to this.

* Make the spacing / line use the same
* Put $schema before the id
* Use title for the short description of the whole meta-schema
* Use "allOf" to combine "$ref" with "description"
* Restore missing "format" and "readOnly" from Draft 04

This makes the meta-schemas correct for Draft 04 and consistently
formatted (with the exception of placement of "definitions" which
will be done separtely to keep the diffs clear).  No Draft 05
changes have been applied at this point.
This makes the placement of "definitions" consistent across
the  meta-schemas.
This uses "uriref" where appropriate and makes the various change
to hyper-schema and links required by the changes to the
hyper-schema spec.
@handrews
Copy link
Contributor Author

handrews commented Dec 2, 2016

OK, I think I have updated this to address @awwright 's concerns. I also only left the draft-05 files in the diff. The current copies in the top directory can be changed separately once these are accepted. This keeps the diff looking more manageable.

@handrews
Copy link
Contributor Author

handrews commented Dec 2, 2016

@awwright @Relequestual --

To review this, do it in these pieces:

Standardize formatting and fix bugs in Draft 04
0013e48

Move "definitions" to be at the top in all meta-schemas (no other changes)
6aac006

Add Draft 05 changes, except for "$ref"
5372503

Add "$ref" for subschemas only
df2c717

Add "self" link to hyperschema
f53cd70

that should be MUCH easier than reviewing it as a giant add.

@handrews
Copy link
Contributor Author

handrews commented Dec 2, 2016

@JanTvrdik noted on the PR in json-schema-spec that I probably have the negation for "$ref" wrong, let me sort that out and update the commit...

This ensures that subschemas are either "normal" JSON Schema
objects according to the declared vocabulary, or references.

The separate definitions of jsonReference and notJsonReference
ensure that objects with a "$ref" property that is not a URI
reference fail validation.  If we just negated the jsonReference
defintion, then {"$ref": 4} would validate as a non-reference
schema which is incorrect.
@handrews
Copy link
Contributor Author

handrews commented Dec 3, 2016

OK, this should be good to go. Finally. For reals. Unless something else comes up...

The hyper-schema on master in json-schema-spec includes "self" and
"full" links.  This backports the "self" link, but not the "full"
link as Draft 05 removed that proposed link relation from the draft.
"full" will be removed separately from json-schema-spec master.
@handrews
Copy link
Contributor Author

handrews commented Dec 3, 2016

headdesk x 9000
15 minutes until realizing it needed another change! This time re-adding links. OMG wtf is up with this PR :-P

@handrews
Copy link
Contributor Author

handrews commented Dec 3, 2016

@Relequestual @awwright I have updated the commits in the earlier #57 (comment) to link to the updated commits.

@Relequestual
Copy link
Member

Relequestual commented Dec 8, 2016

Noted! I'll get to it ASAP.

@Relequestual
Copy link
Member

I THINK we agreed we would NOT release a draft-5 meta-schema. I'll close this issue now. Please re-open or comment if you dissagree @handrews. Effort appreciated all the same.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants