Should we continue pursuing the stable spec idea? #557
Replies: 9 comments 16 replies
-
I think introducing a stable spec is one of the most valuable things we can do for our community and for us as both implemeters and as people who provide support for the community. Yes, it's going to require some changes and change is never easy, but the benefit in the long run I think is huge. Our reasons for wanting to have a stable spec hasn't changed. The proliferation of versions of JSON Schema is a problem and I think it would be a mistake to continue on that path. It's confusing for users and a burden on implementers as well as schema maintatiners. I believe this is the biggest complaint we have about the health of JSON Schema as a whole. People are tired of the churn and are sticking with older versions like draft-07 because they feel it's stable (there are other reasons people are choosing draft-07, but that's definitely one of them). With a stable version of JSON Schema, people no longer have to worry about updating their legacy schemas or the libraries they depend on dropping support for the version their using. Those schemas will continue to work the way they always have with no effort on their part. Sure, they could use alterschema to update their schemas, but that requires that they make the effort to do that upgrade and many will consider it risky to change their schemas even if the process is automated. Alterschema isn't a solution, it's a workaround for the problem. A stable spec solves the problem so that the workaround is no longer necessary.
This is something we needed to do regardless of whether we have a stable spec. We addressed this problem in the context of solving for forward compatibility, but it also addresses one of the biggest problems and biggest complains we have. It allows for detection of typos in schema keywords as well as many structural errors we see in schemas. That said, I don't think it's fair to say that people hated this change. The feedback from hacker news was almost entirely uninformed or unrelated to the issue. The few productive comments did lead to us adding the As for issues this change creates for the vocabulary system, the vocabulary system was always experimental and has many issues that need to be resolved regardless of what we do with the rest of the spec, so I'm not worried about any issues this creates with the vocabulary system because it needs a full rework anyway.
I wouldn't describe what's happened as "cascading complications". I think the only thing we've discussed that wasn't anticipated was optional vocabularies becoming meaningless and I'm not concerned about that for now. There are certainly many things we need to work out, but I don't think we're seeing unexpected problems arise from the decisions we're making. I feel like we're working through an expected set of changes one at a time. I don't perceive that set expanding as we go, although it wouldn't be unexpected to see some of that happen. Also, I see all of the changes we're discussing as positive changes, not compromises, concessions, or complications necessary to get us to a stable spec. They make JSON Schema less complicated for users, implementers, and schema maintainers alike. I think it feels complicated because things are changing, but I think these changes will all serve to reduce complication as a whole for everyone.
Agreeing on how to move to a stable spec has certainly been more difficult than I expected, but I don't think that's a sign we're on the wrong track. I think it's just that we've been doing a poor job working together in a constructive and productive way. I'd hate to see us abandon this initiative that would be so beneficial for JSON Schema because we're too dysfunctional to get it done and it's easier to stick with the status quo. |
Beta Was this translation helpful? Give feedback.
-
It's good to see both of these perspectives so clearly (and reasonably!) articulated. Without coming to a complete conclusion, I would like to draw out three separate things:
One thing that is challenging is that we will never have the perfect spec, and we are really deciding how many "known issues" we are going to "ship with", including things which we know are going to get a total overhaul. That's all fine by me - but how that is messaged (to the marketing point) is critical to containing the future (inevitable) HN pile-on. |
Beta Was this translation helpful? Give feedback.
-
I think this is a complex issue. The "stable" and "living" approaches both have clear pros & cons. While I certainly don't represent the entirety of the JSON Schema community (which has incredibly wide set of use cases), the outcomes I look forward to are:
I think the problem that @gregsdennis is trying to point out is that those two above points might conflict. On one side, JSON Schema could really use some stability, but at the same time, stability might hinder the ability to innovate and shake things up on a positive way. If JSON Schema stops making major changes for the sake of backwards compatibility, then it might get "stuck" with current decisions instead of continuing to push forward. It'd mean often accepting the current status quo even if we all think it can be improved, which doesn't really make sense either. I don't have any specific proposals in mind, but I do wonder if there is a third option, that is somewhat hybrid between the two, and that would ensure a high degree of stability while still welcoming breaking changes when they make sense. Take HTTP as an example. There is rarely a new version of the HTTP protocol going out. But when there is, they are not afraid from truly shaking up how the protocol works (i.e. HTTP/2 vs HTTP/1.1). Maybe there could be a "living" specification of JSON Schema (that users opt-in for) that focuses on innovation and resolving foundational problems with JSON Schema without being afraid to break things, and only at certain points (and not very often, say every 5 years?), a "stable"/"long term support" version is cut out of it? |
Beta Was this translation helpful? Give feedback.
-
To me this is an over-complex issue :) As I tried to put forward quite awhile ago, in my opinion we should be "living" this philosophy rather than spending all this time talking about it -- specifically I would love to see us put out a stable specification purely by it being stable, rather than talking about all of these things ahead of time. If we do that 2 or 3 times in the next year or two, it will be clear we're getting in a groove, and can then formalize what we're doing, and address how it affects any existing behavior (e.g. by obviating the need for I would love to see a spec version with no breaking changes in it -- or with only the ones with overwhelming consensus -- purely to indicate we're moving forward. Nearly none of what's listed in the original comment is necessary in order to do that -- all of what's there indeed are things we have chosen to discuss alongside it. So it's very odd to me to label those things as being what "stable spec" means rather than stable spec meaning what it means, and all those things being things that if we indeed find contentious then we don't do them, or we do them later. But there's absolutely no good reason why we couldn't put out a stable spec in the same way as we've put out all previous specifications, we've simply continued to choose not to do so in my view. |
Beta Was this translation helpful? Give feedback.
-
We are discussing stable vs iterative releases when we still need to agree in the Specification Development Process and this is having us in a chick egg paradox status limiting our progress. My suggestion is to drive our efforts towards defining the Specification Development Process which is something we can define with less limitations. Once we have the spec development process clear I am sure it will be much easier to manage the scope of the next release, otherwise we will stay in this chicken egg status. What is our motivation to release a new version of JSON Schema?
With a spec development process we will have someone championing each release and a way to discuss the scope, make it visible and track the progress. My conclusion: This lack of a clearly defined spec development process is in my opinion the main hurdle. |
Beta Was this translation helpful? Give feedback.
-
I wasn't sure that was official. If this is the decided approach we should update the contributing guidelines of the spec repo. |
Beta Was this translation helpful? Give feedback.
-
Hi. While being a newcomer to this project, I've known about it for quite some time. I have learned that the most recent draft had expired almost exactly a year ago [1] (?!). Additionally, based on what I am reading here, there doesn't seem to be much progress to get to an updated version of even a draft, let alone something stable. This is unfortunate as this project could be so useful in my work. Am I correct in saying that this should not be/is not ready to be used in production at the moment?
There are times when this is necessary to say, and this is one of those times. I see many technical reasons why things haven't progressed (and they may be valid) but it's all useless if users can't get use out of JSON Schema. I'm new here, so I think I've said enough, but want to ask you all to just pick a direction. Bugs and pushback are inevitable whichever direction you take, anyway. 1: https://json-schema.org/draft/2020-12/json-schema-core#section-boilerplate.1-3 |
Beta Was this translation helpful? Give feedback.
-
I've now had a month to think about all of this, and it seems to me that the root problem we're trying to address is how to manage breaking changes between versions of JSON Schema. The current "stable spec" proposals tries to address breaking changes by saying that we just shouldn't have them. I question the sustainability of such an approach. Breaking changes aren't all that badPersonally, I don't mind breaking changes so long as there is:
A question I'd like to explore is, why does a dev update to newer versions of JSON Schema or to newer versions of a library? I can only think of three reasons:
Security/bug fixesThis really only applies to libraries, and even then will only cause a break if the newer version (that contains the fix) drops some support that is needed. This is ultimately a decision for the implementor on how they want to manage their library, and, as JSON Schema, we can't do anything here. New featuresIf you want access to a new feature, you need to use a version that supports that feature. But that doesn't mean that you need the latest version. You need the earliest version that supports the feature and contains any fixes that apply to your use case. As an example, while we generally recommend that people use the latest version of JSON Schema, we also regularly recognize that people don't typically need the dynamic references or other features and can usually just use draft 7 as it usually it contains the features they need and it's the most widely supported version. As such, a user doesn't need to reference the latest version of a library; they just need to reference some version that supports draft 7. "Latest" mindsetThe primary argument for maintaining references at their latest versions is that it reduces the workload (or at least spreads it out) for when you eventually do need those latest features while also keeping you updated on security patches and bug fixes. However, this assumes that you will eventually need those new features and that all patches are applicable to your use case. I'd argue that in most cases, a dev isn't going to need new features in their day-to-day. Updating religiously creates an unnecessary workload when that time can be better spent on the work the business needs done. It's a YAGNI issue, and if new features aren't needed and none of the fixes apply, then there's no reason to update. This is especially evident in the case where a library drops support for an older spec version (for whatever reason). Keeping the library reference perpetually updated means that the user has to update all of their schemas right then. This is waste because:
It doesn't make sense to spend the time/effort/money performing continuous no-op updates; accumulated small efforts typically have a non-trivial cost. However, it does makes sense to stay with the older library version that supports their existing and proven schemas. Later, when JSON Schema eventually updates with features they want to use, then it makes sense to update the library to a version that supports those new features because they're going to be updating their schemas anyway. A case for breaking changesFrom draft 7 to draft 2019-09, If we had made this change under the proposed "no breaking changes" policy, we would have had to make a new keyword to do what Sure, This doesn't solve the problem of people needing to update their schemas because of a breaking change. This approach hides the problem (which is arguably worse) by separating the old way and the new. Instead, we kept the existing keyword and tweaked its behavior so that it worked in a way that many users already expected. It didn't change previous "proper" use (where there were no siblings), and the only breaking case was that it would evaluate siblings where previously it didn't, which would only break schemas by authors who expected siblings to be ignored and used them anyway. This is a good breaking change, and I'd hate for us to handcuff ourselves via policy in a way that doesn't allow us to do something like this in the future. Proper managementI'm not saying all of this to imply that we just throw all caution to the wind and make whatever changes we want whenever we want to. I still think that we should be decisive and very conservative in the changes we propose. But let's not completely throw out the idea of breaking changes; let's find a good way to manage them. Historically, that has been through extensive discussion and impact analysis, and I think it's fine to continue with that. I think ADRs are a good mechanism to help manage and communicate these kinds of changes. But because we haven't published since we introduced them (we published 2020-12m, but the first ADR is Apr 2022), we haven't had a legitimate opportunity to trial them. Future keywordsThe proposal requires that we disallow unknown keywords because they might collide with keywords that either we (JSON Schema) or some third party vocabulary have yet to define (i.e. "future proofing" or "forward compatibility"). I think this is rather forceful and overly strict. Instead, I'd like to simply add language that says something like:
(We can even still protect the This enables:
Moreover, I'd like to propose that we include language that says support for experimental features MUST be hidden behind a configuration, defaulted to off. This way, users opt-in to experimental support. Catching spelling errorsThe other claimed benefit to disallowing unknown keywords is catching spelling errors, e.g. We don't need to disallow unknown keywords to do this; we can just publish a closed meta-schema in addition to the open one that we've been publishing. Creating and using a closed meta-schema is the advice that we've been giving people for as long as I can remember, and there's nothing stopping us from just publishing it ourselves. Deprecated keywordsWe're still going to want to deprecate keywords for various reasons. I'm okay with having a policy that deprecated keywords remain supported for one or two versions, but they should not be supported after that; otherwise, we would only be holding ourselves and implementors back, not moving forward, by having requirements that incur bloat. (I recognize that since these deprecated keywords don't change, there's not much of a maintenance cost because the code to support them is written, but there is still a runtime cost for end users who have to load libraries into memory, e.g. .Net, or download them, e.g. JS. The maintenance cost that does exist is more around code refactors and such, which don't/shouldn't happen often.) That said, and in conjunction with what I said above, re-using keywords by merely tweaking their function slightly, with deliberation and discussion, as was done with ProcessI'm not sure that we need to define everything about the process right away. I find myself in agreement with @Julian's comment in that, at least for now, we continue releasing versioned specs without this idea of a live/active version (which I still don't think that we have the numbers for), while also keeping a mindset that we, being the responsible party, need to minimize breaking changes where we can. I think we had done well up through the change from draft 7 to draft 2019-09, but some of the changes in draft 2020-12 were particularly disruptive.
I think we all agree that these were necessary changes, however I also question whether we were properly diligent in analyzing the impact that these changes would have. Perhaps better pre-publication communication of the changes could have helped. ConclusionOverall, after extensively considering everything in the comments above and my own deliberation, I still don't think that the live stable spec proposal is right for this project, and I'd like to see this project start actually moving forward again under the publication approach that we've previously used, while also being more conscious of the impact of the changes and other decisions we make. |
Beta Was this translation helpful? Give feedback.
-
Closing this in favor of https://github.com/orgs/json-schema-org/discussions/671 |
Beta Was this translation helpful? Give feedback.
-
For the past year, we've followed along with an idea to make a "stable"/"living" specification. In that time, we've identified multiple aspects of managing the specification that had to change, including some changes to the specification itself and how JSON Schema works fundamentally. Below is some of the fallout of making this decision:
x-
(how to do this was divisive)$vocabulary
worksAfter a year of trying to put everything in place to transition to a stable spec, the only thing I've witnessed is how it creates cascading complications where providing a solution for one just leads to identifying another. It's very likely there will be more fundamental changes as we continue down this road.
Publishing disjoint specifications (as we have until now) doesn't need any of this. Furthermore, with the creation of
alterschema
, there's less of a need to have a stable spec since converting between versions is as simple as running a tool. Updating to later versions is less of a hassle.If we abandon the stable spec idea, none of the above is in question. Additionally, we can still:
My conclusion is that we should return to iterative releases, abandoning the stable spec concept. It was a good exercise to explore the idea, and there are some things we can take away from it, but I don't think that this is the right direction for the project in the long term.
Beta Was this translation helpful? Give feedback.
All reactions