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
Copy file name to clipboardExpand all lines: versions/3.0.4.md
+37-6
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,10 @@ The OpenAPI Specification (OAS) defines a standard, language-agnostic interface
12
12
13
13
An OpenAPI definition can then be used by documentation generation tools to display the API, code generation tools to generate servers and clients in various programming languages, testing tools, and many other use cases.
14
14
15
+
For examples of OpenAPI usage and additional documentation, please visit [learn.openapis.org](https://learn.openapis.org/).
16
+
17
+
For extension registries and other specifications published by the OpenAPI Initiative, please visit [spec.openapis.org](https://spec.openapis.org/)
@@ -96,6 +100,11 @@ Some examples of possible media type definitions:
96
100
The HTTP Status Codes are used to indicate the status of the executed operation.
97
101
Status codes SHOULD be selected from the available status codes registered in the [IANA Status Code Registry](https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml).
98
102
103
+
##### <aname="httpAndCaseSensitivity"></a>HTTP and Case Sensitivity
104
+
105
+
As most field names and values in the OpenAPI Specification are case-sensitive, this document endeavors to call out any case-insensitive names and values.
106
+
However, the case sensitivity of field names and values that map directly to HTTP concepts follow the case sensitivity rules of HTTP, even if this document does not make a note of every concept.
107
+
99
108
##### <aname="undefinedAndImplementationDefinedBehavior"></a>Undefined and Implementation-Defined Behavior
100
109
101
110
This specification deems certain situations to have either _undefined_ or _implementation-defined_ behavior.
@@ -139,7 +148,7 @@ Patterned fields MUST have unique names within the containing object.
139
148
140
149
In order to preserve the ability to round-trip between YAML and JSON formats, YAML version [1.2](https://yaml.org/spec/1.2/spec.html) is RECOMMENDED along with some additional constraints:
141
150
142
-
- Tags MUST be limited to those allowed by the [JSON Schema ruleset](https://yaml.org/spec/1.2/spec.html#id2803231).
151
+
- Tags MUST be limited to those allowed by [YAML's JSON schema ruleset](https://yaml.org/spec/1.2/spec.html#id2803231), which defines a subset of the YAML syntax and is unrelated to [JSON Schema](https://tools.ietf.org/html/draft-wright-json-schema-00).
143
152
- Keys used in YAML maps MUST be limited to a scalar string, as defined by the [YAML Failsafe schema ruleset](https://yaml.org/spec/1.2/spec.html#id2802346).
144
153
145
154
**Note:** While APIs may be defined by OpenAPI documents in either YAML or JSON format, the API request and response bodies and other content are not required to be JSON or YAML.
@@ -176,6 +185,8 @@ Models are defined using the [Schema Object](#schemaObject), which is an extende
176
185
OAS uses several known formats to define in fine detail the data type being used.
177
186
However, to support documentation needs, the `format` property is an open `string`-valued property, and can have any value.
178
187
Formats such as `"email"`, `"uuid"`, and so on, MAY be used even though they are not defined by this specification.
188
+
The OpenAPI Initiative also hosts a [Format Registry](https://spec.openapis.org/registry/format/) for formats defined by OAS users and other specifications. Support for any registered format is strictly OPTIONAL, and support for one registered format does not imply support for any others.
189
+
179
190
Types that are not accompanied by a `format` property follow the type definition in the JSON Schema. Tools that do not recognize a specific `format` MAY default back to the `type` alone, as if the `format` is not specified.
180
191
181
192
The formats defined by the OAS are:
@@ -205,7 +216,11 @@ Note that the encoding indicated by `byte`, which inflates the size of data in o
205
216
206
217
### <aname="richText"></a>Rich Text Formatting
207
218
Throughout the specification `description` fields are noted as supporting CommonMark markdown formatting.
208
-
Where OpenAPI tooling renders rich text it MUST support, at a minimum, markdown syntax as described by [CommonMark 0.27](https://spec.commonmark.org/0.27/). Tooling MAY choose to ignore some CommonMark features to address security concerns.
219
+
Where OpenAPI tooling renders rich text it MUST support, at a minimum, markdown syntax as described by [CommonMark 0.27](https://spec.commonmark.org/0.27/). Tooling MAY choose to ignore some CommonMark or extension features to address security concerns.
220
+
221
+
While the framing of CommonMark 0.27 as a minimum requirement means that tooling MAY choose to implement extensions on top of it, note that any such extensions are by definition implementation-defined and will not be interoperable.
222
+
OpenAPI Description authors SHOULD consider how text using such extensions will be rendered by tools that offer only the minimum support.
223
+
209
224
210
225
### <aname="relativeReferences"></a>Relative References in URLs
211
226
@@ -218,6 +233,11 @@ Relative references in CommonMark hyperlinks are resolved in their rendered cont
218
233
219
234
### Schema
220
235
236
+
This section describes the structure of the OpenAPI Description format.
237
+
This text is the only normative description of the format.
238
+
A JSON Schema is hosted on [spec.openapis.org](https://spec.openapis.org) for informational purposes.
239
+
If the JSON Schema differs from this section, then this section MUST be considered authoritative.
240
+
221
241
In the following description, if a field is not explicitly **REQUIRED** or described with a MUST or SHALL, it can be considered OPTIONAL.
222
242
223
243
#### <aname="oasObject"></a>OpenAPI Object
@@ -253,7 +273,7 @@ Field Name | Type | Description
253
273
<aname="infoTermsOfService"></a>termsOfService | `string` | A URL to the Terms of Service for the API. MUST be in the format of a URL.
254
274
<aname="infoContact"></a>contact | [Contact Object](#contactObject) | The contact information for the exposed API.
255
275
<aname="infoLicense"></a>license | [License Object](#licenseObject) | The license information for the exposed API.
256
-
<aname="infoVersion"></a>version | `string` | **REQUIRED**. The version of the OpenAPI document (which is distinct from the [OpenAPI Specification version](#oasVersion) or the API implementation version).
276
+
<aname="infoVersion"></a>version | `string` | **REQUIRED**. The version of the OpenAPI document (which is distinct from the [OpenAPI Specification version](#oasVersion) or the version of API being described).
257
277
258
278
259
279
This object MAY be extended with [Specification Extensions](#specificationExtensions).
@@ -2002,6 +2022,11 @@ transactionCallback:
2002
2022
2003
2023
#### <a name="exampleObject"></a>Example Object
2004
2024
2025
+
An object grouping an internal or external example value with basic `summary` and `description` metadata.
2026
+
This object is typically used in properties named `examples` (plural), and is a [referenceable](#referenceObject) alternative to older `example` (singular) fields that do not support referencing or metadata.
2027
+
2028
+
Examples allow demonstration of the usage of properties, parameters and objects within OpenAPI.
2029
+
2005
2030
##### Fixed Fields
2006
2031
Field Name | Type | Description
2007
2032
---|:---:|---
@@ -3094,7 +3119,8 @@ This object MAY be extended with [Specification Extensions](#specificationExtens
3094
3119
3095
3120
##### XML Object Examples
3096
3121
3097
-
The examples of the XML object definitions are included inside a property definition of a [Schema Object](#schemaObject) with a sample of the XML representation of it.
3122
+
Each of the following examples represent the value of the `properties` keyword in a [Schema Object](#schemaObject) that is omitted for brevity.
3123
+
The JSON and YAML representations of the `properties` value are followed by an example XML representation produced for the single property shown.
3098
3124
3099
3125
###### No XML Element
3100
3126
@@ -3671,9 +3697,14 @@ The extensions properties are implemented as patterned fields that are always pr
3671
3697
3672
3698
Field Pattern | Type | Description
3673
3699
---|:---:|---
3674
-
<a name="infoExtensions"></a>^x- | Any | Allows extensions to the OpenAPI Schema. The field name MUST begin with `x-`, for example, `x-internal-id`. The value can be `null`, a primitive, an array or an object. Can have any valid JSON format value.
3700
+
<a name="infoExtensions"></a>^x- | Any | Allows extensions to the OpenAPI Schema. The field name MUST begin with `x-`, for example, `x-internal-id`. The value can be any valid JSON format value (`null`, a primitive, an array or an object.)
3701
+
3702
+
The OpenAPI Initiative maintains several [extension registries](https://spec.openapis.org/registry/index.html), including registries for [individual extension keywords](https://spec.openapis.org/registry/extension/) and [extension keyword namespaces](https://spec.openapis.org/registry/namespace/).
3703
+
3704
+
Extensions are one of the best ways to prove the viability of proposed additions to the specification.
3705
+
It is therefore RECOMMENDED that implementations be designed for extensibility to support community experimentation.
3675
3706
3676
-
The extensions may or may not be supported by the available tooling, but those may be extended as well to add requested support (if tools are internal or open-sourced).
3707
+
Support for any one extension is OPTIONAL, and support for one extension does not imply support for others.
0 commit comments