How to manage meta-schema updates between draft releases #48
Replies: 4 comments 4 replies
-
To be clear, these URIs would be used as the
|
Beta Was this translation helpful? Give feedback.
-
The timestamps here are confusing -- one is a draft version, and the other is a release date. Using the release date after the draft version here as well would be a little clearer. I would suggest using a full YYYY-MM-DD format for the release date, so it looks less like a draft version. Also it allows for the possibility of two revisions in the same month, which can certainly happen if errors are made in the first fix. |
Beta Was this translation helpful? Give feedback.
-
Sounds like it's time for |
Beta Was this translation helpful? Give feedback.
-
I wonder if what consumers are mostly interested in is whether a given schema is backwards-compatible, forwards-compatible or fully-compatible with respects to the previous schema. Maybe that aspect can be encoded into some sort of JSON Schema custom versioning strategy? Having that information embedded into the versioning would greatly simplify many schema evolution use cases. |
Beta Was this translation helpful? Give feedback.
-
Although we try not to change the meta-schema between draft releases, sometimes it's necessary. In the past, we've only made changes for the most critical bugs and we made those changes in place (same URI). The spec says, the following about meta-schema updates.
The part about assuming the syntax and semantics based on the URI is not correct because
$schema
is not the indicator of the version of the spec the schemas uses. It's now$vocabulary
that determines semantics. In @handrews's words,So technically, releasing a meta-schema with a new URI shouldn't be a problem for implementations, but it would be very confusing for the community. When people start seeing
$schemas
likehttps://json-schema.org/draft/2021-04/schema
, it's ambiguous whether a new draft came out or a bug was fixed in the meta-schema. Even tho$schema
doesn't actually identify the draft semantics, that is the primary signal users will use to determine which draft a schema adheres to when reading a schema and it should send a clear message to the user.Proposal
Meta-schema updates should include a version identifier such as
https://json-schema.org/draft/{draft}/schema/{version}
. The original templatehttps://json-schema.org/draft/{draft}/schema
can be used to refer to the "latest" version for that draft. If you want updates automatically, you can use the "latest" template. If you want to pin to a specific version you can use the "version" template. Both templates clearly indicate which draft semantics are in use.Original Discussion: json-schema-org/json-schema-spec#1089
Beta Was this translation helpful? Give feedback.
All reactions