-
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
Remove swagger: 2.0 from spec #561
Comments
parent issue: #560 |
Spec versionning could instead be specified using the existing feature of JSON Schema: the |
Agree @dolmen |
@dolmen If I understand correctly, JSON schema alone is not enough to completely validate an OpenAPI document (at least in version 2.0), thus some additional OpenAPI specific logic is necessary anyways. (Of course that logic could be coded to recognize a specific hard-coded JSON schema URI instead of |
|
@webron, indeed that is the case within a JSON Schema. Perhaps simply pointing to it at /schema for tooling is fair game: {
"schema": {"$ref": "http://openapis.org/schema/v2.0/schema.json"}
} About versions, I agree with the OP, and it needs to live somewhere, but living in a URI is a bit opaque. I would still like the ability to extend and validate by specifying a schema property, but perhaps depending on a path component for a version is unnecessarily terse. {
"schema": {"$ref": "http://openapis.org/schema/v2.0.0/schema.json"},
"version": "x.y.z"
} |
All @fehguy was trying to say is is it should change from: |
Apologies :) I am guilty of a bit of a co-opting/hope of omnibus above, after arriving here from #496 |
In semver, the third part is about backwards-compatible bug fixes. A bug fix resolves a problem of implementation. But here, we are speaking about versioning of a specification, not the versioning of an implementation. Semver could be used in a version field of the JSON Schema for OpenAPI or in a version field of the documentation of the OpenAPI specification (the document itself is versioned and may evolve to add clarification of the specification, without changing the meaning) but not in the OpenAPI specification itself. @webron |
@dolmen that's a separate issue. This ticket is about the version field of the spec which is currently represented by the As for whether we use semver or not, that's definitely part of the discussion here. Personally, I don't have a strong opinion here. In my experience we've made different types of changes to the document since it was officially released. I can bring some of those here so we can discuss what kind of version changes those would potentially require, if anything at all. |
Here is my proposal for addressing this. Options:
Pros:
Cons:
Recommendation:
which will eventually be released as:
The multiple
example:
|
@whitlockjc @fehguy How this will correlate with schema versioning? For example, some user creates his spec inside I propose to include all schema changes as In this case, tooling can notify users that spec was fixed and he need to fix his OAI spec. |
No, these are quite different considerations.
That said, using a schema to point to the OAI specification version doesn't make sense. That's because the source of truth is the document itself, not the JSON Schema. I do believe that we can and will become better about making changes (and therefore versioning) the JSON Schema but that is entirely differently. Point being, the JSON schema is not the source of truth for the OAI spec. Recall too that it is up to the tooling to use a schema or not, so we cannot blame the specification for how the tooling uses it. |
I never thought about it like that @fehguy, I'm glad you brought that up. Tooling authors using JSON Schema is a choice, not a requirement. That definitely helps me look at some of these requests a little differently. |
@fehguy In that case, I suggest to change Aliasing isn't a problem since Git support symlinks. |
The current OpenAPI spec has
"swagger": "2.0"
in it. Since it's no longer called the swagger spec, this should go away.I do believe we should continue to declare the version in the specification though, to make tooling more tolerant. Some points about that.
x.y.z
format.The text was updated successfully, but these errors were encountered: