Versioning Schema URIs

14 views
Skip to first unread message

Gary Court

unread,
Sep 13, 2010, 6:12:54 PM9/13/10
to JSON Schema
I would like to propose that, going forward on JSON Schema
specification revisions, we start versioning the official JSON Schema/
Hyper-Schema URIs. What I mean by this is that for each revision of
the offical JSON Schema specification, we create new official JSON
Schema/Hyper-Schema URIs for that version.

For example; For the next revision (3) of the JSON Schema
specification, the URIs of the JSON Schema would be:
http://json-schema.org/draft-03/schema
http://json-schema.org/draft-03/hyper-schema

The reason I propose this is that it would allow a JSON Schema
validator to validate a JSON document based on the rules of the
version the schema is written to.

For example; take the following schema:

{
"$schema" : "http://json-schema.org/draft-02/hyper-schema",
"properties" : {
"a" : {}
}
}

A validator can examine the "describedby" link "$schema" and
understand that this schema (and it's subschemas) are written assuming
revision 2 rules, and that the property "a" is required (not optional,
unlike revision 3 rules). Because any schema can have this link, this
allows for embedding/referencing other schemas that validate using
newer (or older) schema rules.

This would immensely help in providing backwards compatability with
schemas written using older revision rules.
Reply all
Reply to author
Forward
0 new messages