Skip to content

Commit 1b57df4

Browse files
author
Ron
authored
Merge pull request OAI#1199 from DavidBiesack/semver
Semantic Versioning
2 parents 4e64384 + 567a519 commit 1b57df4

File tree

1 file changed

+19
-14
lines changed

1 file changed

+19
-14
lines changed

versions/3.0.md

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,12 @@ Additional utilities, such as testing tools, can also use the files.
2020
<!-- TOC depthFrom:1 depthTo:3 withLinks:1 updateOnSave:1 orderedList:0 -->
2121

2222
- [Definitions](#definitions)
23+
- [OpenAPI Definition File](#oasDefinitionFile)
2324
- [Path Templating](#pathTemplating)
2425
- [Media Types](#mediaTypes)
2526
- [HTTP Status Codes](#httpCodes)
2627
- [Specification](#specification)
28+
- [Versions](#versions)
2729
- [Format](#format)
2830
- [File Structure](#fileStructure)
2931
- [Data Types](#dataTypes)
@@ -68,6 +70,9 @@ Additional utilities, such as testing tools, can also use the files.
6870

6971
## Definitions
7072

73+
##### <a name="oasDefinitionFile"></a>OpenAPI Definition File
74+
A file or set of files which defines an API. The OpenAPI definition file uses and conforms to the OpenAPI Specification.
75+
7176
##### <a name="pathTemplating"></a>Path Templating
7277
Path templating refers to the usage of curly braces ({}) to mark a section of a URL path as replaceable using path parameters.
7378

@@ -94,6 +99,16 @@ The available status codes are defined by [RFC7231](http://tools.ietf.org/html/r
9499

95100
## Specification
96101

102+
### Versions
103+
104+
The OpenAPI Specification is versioned using [Semantic Versioning 2.0.0](http://semver.org/spec/v2.0.0.html) (semver) and follows the semver specification.
105+
106+
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.
107+
108+
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`.
109+
110+
An OpenAPI definition file compatible with OAS 3.\*.\* contains a required [`openapi`](#oasVersion) field which designates the semantic version of the OAS that it uses. (OAS 2.0 definition document contain a top-level version field named [`swagger`](http://swagger.io/specification/#swaggerObject) and value `"2.0"`.)
111+
97112
### Format
98113

99114
An API description that conforms to the OpenAPI Specification is itself a JSON object, which may be represented either in JSON or YAML format.
@@ -120,7 +135,7 @@ In order to preserve the ability to round-trip between YAML and JSON formats, YA
120135

121136
### <a name="fileStructure"></a>File Structure
122137

123-
The OAS representation of the API is made of a single file.
138+
An OpenAPI definition file is made of a single file.
124139
However, parts of the definitions can be split into separate files, at the discretion of the user.
125140
This is applicable for `$ref` fields in the specification as follows from the [JSON Schema](http://json-schema.org) definitions.
126141

@@ -141,7 +156,6 @@ Types that are not accompanied by a `format` property follow the type definition
141156

142157
The formats defined by the OAS are:
143158

144-
145159
Common Name | [`type`](#dataTypes) | [`format`](#dataTypeFormat) | Comments
146160
----------- | ------ | -------- | --------
147161
integer | `integer` | `int32` | signed 32 bits
@@ -173,13 +187,13 @@ In the following description, if a field is not explicitly **REQUIRED** or descr
173187

174188
#### <a name="oasObject"></a>OpenAPI Object
175189

176-
This is the root document object for the API specification.
190+
This is the root document object of the [OpenAPI definition file](#oasDefinitionFile).
177191

178192
##### Fixed Fields
179193

180194
Field Name | Type | Description
181195
---|:---:|---
182-
<a name="oasVersion"></a>openapi | `string` | **REQUIRED**. Specifies the OpenAPI Specification version being used. It can be used by tooling specifications and clients to interpret the version. The structure SHALL be `major`.`minor`.`patch`, where `patch` versions MUST be compatible with the existing `major`.`minor` tooling. Typically patch versions will be introduced to address errors in the documentation, and tooling SHOULD typically be compatible with the corresponding `major`.`minor` (3.0.\*). Patch versions will correspond to patches of this document.
196+
<a name="oasVersion"></a>openapi | `string` | **REQUIRED**. This string MUST be the [semantic version number](http://semver.org/spec/v2.0.0.html) of the [OpenAPI Specification version](#versions) that the OpenAPI definition file uses. The `openapi` field SHOULD be used by tooling specifications and clients to interpret the OpenAPI definition file. This is *not* related to the API [`info.version`](#infoVersion) string.
183197
<a name="oasInfo"></a>info | [Info Object](#infoObject) | **REQUIRED**. Provides metadata about the API. The metadata can be used by the clients if needed.
184198
<a name="oasServers"></a>servers | [[Server Object](#serverObject)] | An array of Server Objects, which provide connectivity information to a target server. If the `servers` property is not provided, or is an empty array, the default value would be a [Server Object](#serverObject) with a [url](#serverUrl) value of `/`.
185199
<a name="oasPaths"></a>paths | [Paths Object](#pathsObject) | **REQUIRED**. The available paths and operations for the API.
@@ -190,15 +204,6 @@ Field Name | Type | Description
190204

191205
This object can be extended with [Specification Extensions](#specificationExtensions).
192206

193-
#### <a name="oasVersionString"></a>OpenAPI Version String
194-
195-
The version string signifies which OpenAPI Specification version the document complies to. The format for this string MUST be `major`.`minor`.`patch`. The `patch` MAY be suffixed by a hyphen and extra alphanumeric characters.
196-
197-
A `major`.`minor` SHALL be used to designate the OpenAPI Specification version, and will be considered compatible with the OpenAPI Specification specified by that `major`.`minor` version. The patch version will not be considered by tooling, making no distinction between `3.0.0` and `3.0.1`.
198-
199-
In subsequent versions of the OpenAPI Specification, care will be given such that increments of the `minor` version SHOULD NOT interfere with operations of tooling developed to a lower minor version. Thus a hypothetical `3.1.0` specification SHOULD be usable with tooling designed for `3.0.0`.
200-
201-
202207
#### <a name="infoObject"></a>Info Object
203208

204209
The object provides metadata about the API.
@@ -213,7 +218,7 @@ Field Name | Type | Description
213218
<a name="infoTermsOfService"></a>termsOfService | `string` | A URL to the Terms of Service for the API. MUST be in the format of a URL.
214219
<a name="infoContact"></a>contact | [Contact Object](#contactObject) | The contact information for the exposed API.
215220
<a name="infoLicense"></a>license | [License Object](#licenseObject) | The license information for the exposed API.
216-
<a name="infoVersion"></a>version | `string` | **REQUIRED**. The version of the API definition (which is distinct from the OpenAPI Specification version or the API implementation version).
221+
<a name="infoVersion"></a>version | `string` | **REQUIRED**. The version of the API definition (which is distinct from the [OpenAPI Specification version](#oasVersion) or the API implementation version).
217222

218223

219224
This object can be extended with [Specification Extensions](#specificationExtensions).

0 commit comments

Comments
 (0)