-
Notifications
You must be signed in to change notification settings - Fork 9.1k
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
Paraphrasing SemVer Caused Confusion #2022
Conversation
This sentance was meant to paraphrase semver for clarifty, but ended up suggesting a confusion situation where new things essentially cannot really happen. @webron has context on this.
Alternate proposal for clarifying semver confusion: If an OAS definition has the minor version incremented, it MUST still be a valid definition for the new minor version. e.g. If we have a document that is 3.0 and we change the version to 3.1, then it MUST a valid 3.1 document. |
@darrelmiller my concern is that we are still paraphrasing SemVer, when semver is capable of speaking for itself? This line seems to have less potential for confusion but I’m not entirely sure we need to drive this point home? |
@philsturgeon I wish I could agree. Perhaps semver could speak for itself if we were deploying a versioned software component, but all semver says about minor versions is the following:
It however doesn't define what "backwards compatible" means. The statement we are adding here is a concrete test to determine backwards compatibility. |
@darrelmiller wrote:
I agree, we need to clarify what we mean by backward-compatible because a textbook definition of backward compatibility (if there is such a thing) might imply a kind of compatibility that we do not and cannot support. Here's Wikipedia:
The language in the current 3.0 spec, deleted in this PR, seems aligned with that definition:
The problem is, this isn't true! Some 3.0 tools, e.g. code generators, are strictly OpenAPI consumers, and they could process a 3.1 document as a 3.0 document, ignoring unknown keywords. Whether it's advisable to do so depends partly on what guarantees OpenAPI makes w.r.t. "backward compatibility" as we define it. But 3.0 editors, validators, and other OpenAPI producers really can't support OpenAPI 3.1 documents, and probably shouldn't try. A 3.0 editor won't work with 3.1 because there are new keywords that 3.0 editors would consider to be errors; and because an
This is exactly what I think we mean, intuitively, by backward compatibility. Maybe it's clearer to state it as a guarantee made by the OpenAPI specification, rather than a requirement on the document:
|
@darrelmiller you win! 🚢 🤡 |
3653bd5
to
086ffd5
Compare
versions/3.0.3.md
Outdated
@@ -102,7 +102,7 @@ The OpenAPI Specification is versioned using [Semantic Versioning 2.0.0](https:/ | |||
|
|||
The `major`.`minor` portion of the semver (for example `3.0`) SHALL designate the OAS feature set. Typically, *`.patch`* versions address errors in this document, not the feature set. Tooling which supports OAS 3.0 SHOULD be compatible with all OAS 3.0.\* versions. The patch version SHOULD NOT be considered by tooling, making no distinction between `3.0.0` and `3.0.1` for example. | |||
|
|||
Subsequent minor version releases of the OpenAPI Specification (incrementing the `minor` version number) SHOULD NOT interfere with tooling developed to a lower minor version and same major version. Thus a hypothetical `3.1.0` specification SHOULD be usable with tooling designed for `3.0.0`. | |||
If an OAS definition has its minor version incremented, it MUST still be a valid definition for the new minor version. E.g., if we have a document that is 3.0.2 and we change the version to 3.1.0, then it MUST be a valid 3.1.0 document. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is "OAS definition" here consistent wording? Not to be confused with definitions
? Do we mean a document
or something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to make a stronger statement than just
it MUST be a valid 3.1.0 document.
I think we should also require that it have the same interpretation as the 3.0.x document.
To illustrate: consider the "required" attribute in a parameter object. It currently defaults to false
. I think that changing this default to true
would be considered a "breaking change", but it would not affect the "validity" of any 3.0.x API doc that was updated to 3.1.0.
I'm not sure how best to word this in the spec, but perhaps something like:
If an OAS definition has its minor version incremented, it MUST still be a valid definition for the new minor version with an equivalent interpretation to the original definition. E.g., if we have a document that is 3.0.2 and we change the version to 3.1.0, then it MUST be a valid 3.1.0 document with an equivalent interpretation to the 3.0.2 definition.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mkistler fair enough! @darrelmiller @webron what do you think? Can somebody hit that sweet sweet Suggest button and try to solve this feedback without removing your own meaning?
Updated language, discussed on the call:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Following the discussions on the TSC call on 2019-10-24, these changes LGTM.
TSC 2019-10-03 Feedback
This sentance was meant to paraphrase semver for clarifty, but ended up suggesting a confusion situation where new things essentially cannot really happen.
@webron has context on this.