You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A file or set of files which defines an API. The OpenAPI definition file uses and conforms to the OpenAPI Specification.
75
+
71
76
##### <aname="pathTemplating"></a>Path Templating
72
77
Path templating refers to the usage of curly braces ({}) to mark a section of a URL path as replaceable using path parameters.
73
78
@@ -94,6 +99,16 @@ The available status codes are defined by [RFC7231](http://tools.ietf.org/html/r
94
99
95
100
## Specification
96
101
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
+
97
112
### Format
98
113
99
114
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
120
135
121
136
### <aname="fileStructure"></a>File Structure
122
137
123
-
The OAS representation of the API is made of a single file.
138
+
An OpenAPI definition file is made of a single file.
124
139
However, parts of the definitions can be split into separate files, at the discretion of the user.
125
140
This is applicable for `$ref` fields in the specification as follows from the [JSON Schema](http://json-schema.org) definitions.
126
141
@@ -141,7 +156,6 @@ Types that are not accompanied by a `format` property follow the type definition
141
156
142
157
The formats defined by the OAS are:
143
158
144
-
145
159
Common Name | [`type`](#dataTypes) | [`format`](#dataTypeFormat) | Comments
146
160
----------- | ------ | -------- | --------
147
161
integer | `integer` | `int32` | signed 32 bits
@@ -173,13 +187,13 @@ In the following description, if a field is not explicitly **REQUIRED** or descr
173
187
174
188
#### <aname="oasObject"></a>OpenAPI Object
175
189
176
-
This is the root document object for the API specification.
190
+
This is the root document object of the [OpenAPI definition file](#oasDefinitionFile).
177
191
178
192
##### Fixed Fields
179
193
180
194
Field Name | Type | Description
181
195
---|:---:|---
182
-
<aname="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
+
<aname="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.
183
197
<aname="oasInfo"></a>info | [Info Object](#infoObject) | **REQUIRED**. Provides metadata about the API. The metadata can be used by the clients if needed.
184
198
<aname="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 `/`.
185
199
<aname="oasPaths"></a>paths | [Paths Object](#pathsObject) | **REQUIRED**. The available paths and operations for the API.
@@ -190,15 +204,6 @@ Field Name | Type | Description
190
204
191
205
This object can be extended with [Specification Extensions](#specificationExtensions).
192
206
193
-
#### <aname="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
-
202
207
#### <aname="infoObject"></a>Info Object
203
208
204
209
The object provides metadata about the API.
@@ -213,7 +218,7 @@ Field Name | Type | Description
213
218
<aname="infoTermsOfService"></a>termsOfService | `string` | A URL to the Terms of Service for the API. MUST be in the format of a URL.
214
219
<aname="infoContact"></a>contact | [Contact Object](#contactObject) | The contact information for the exposed API.
215
220
<aname="infoLicense"></a>license | [License Object](#licenseObject) | The license information for the exposed API.
216
-
<aname="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
+
<aname="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).
217
222
218
223
219
224
This object can be extended with [Specification Extensions](#specificationExtensions).
0 commit comments