-
-
Notifications
You must be signed in to change notification settings - Fork 260
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
Section on managing schema versions? #197
Comments
Do we have any update on this? |
I also think it would be useful to have a version field |
Regarding the aspect "which version number to assign to a JSON schema", a stackoverflow question pointed me to SchemaVer. In short, it recommends following:
|
I was not convinced by SchemaVer. They themselves say that the line between model and revision is blurry. I prefer to use semver with following interpretation:
|
What I'm wondering is how to document historical versions inside schema. Description with |
Nice to see you @KrzysztofMadejski :) Also looking into this; any progress? |
I will bring this topic to the next Community Meeting to see if we can priorize it. |
Hi everyone! We discussed this issue in the last Open Community Meeting: json-schema-org/community#536 The general opinion was that this is a software engineering concern, more than a JSON Schema concern. Having said that, or recommendation is that schemas should be immutable and if a new version is required, we recommend use a new file with new ID, leaving the decision of how to manage it up to the users. We also agreed on adding this to a future FAQ page. We hope this helps! |
We'll close this for now with the previous comment added. Please feel free to open it again if you feel we need to continue the discussion. Thanks everyone!! |
This topic was a recent discussion in the Web of Things work at the W3C where we publish JSON Schemas next to our standard. If we were to use semantic versioning, we have thought of the following assignments to the meaning of patch, minor and major:
I think that this is very closely aligned with what @KrzysztofMadejski mentioned above, I wish I had found this thread a couple of weeks ago :) I think that there are still open points:
After reading that article, this feels like a breaking change, even though intuitively I would have said that it is a minor change. |
For those adopting semantic versioning, one should also document, as did SchemaVer, if versioning starts from 1 or 0:
|
I'm currently trying to come up with a solid way to manage schema versions, and to manage migrations/upgrades of objects matching those schemas. I started a discussion at json-schema-org/json-schema-spec#19 , but it should more properly be discussed here, I think, so copying the contents over:
I wonder if it might be worth addressing a "recommended versioning/upgrade pathway methodology" or similar in the book.
I'm trying to implement something like this in a private project, and thinking of using something along the lines of:
current_version
file that keeps track of the current stable version of the schema for each object type.previousVersion
tag in each version of the schema (e.g.v1.1.0
might havepreviousVersion: 1.0.7
)schemaVersion
property.upgrade_v1.1.0_from_v.1.0.7.py
,upgrade_v1.1.0_from_v.1.0.7.js
), which handle the upgrade, and which can be chained (with pre-and post-validation).This feels like a sensible idea, because it keeps all of the validation and upgrade logic in the same place, and allows each part to be used as-needed in each app (in particular we have a large object store that will have objects with various different versions that need upgrading as they are accessed and used by other apps in the system).
I thought I'd chuck this up here because it might be useful as a basis for a more sensible methodology recommendation, and for the possibility that I might get some feedback on it :)
The text was updated successfully, but these errors were encountered: