Skip to content

Commit f8d4abb

Browse files
authored
Merge pull request #3861 from handrews/editorial-304
Various minor editorial improvements (3.0.4)
2 parents 945905d + fdb9570 commit f8d4abb

File tree

1 file changed

+37
-6
lines changed

1 file changed

+37
-6
lines changed

versions/3.0.4.md

+37-6
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ The OpenAPI Specification (OAS) defines a standard, language-agnostic interface
1212

1313
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.
1414

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/)
18+
1519
## Table of Contents
1620
<!-- TOC depthFrom:1 depthTo:3 withLinks:1 updateOnSave:1 orderedList:0 -->
1721

@@ -96,6 +100,11 @@ Some examples of possible media type definitions:
96100
The HTTP Status Codes are used to indicate the status of the executed operation.
97101
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).
98102

103+
##### <a name="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+
99108
##### <a name="undefinedAndImplementationDefinedBehavior"></a>Undefined and Implementation-Defined Behavior
100109

101110
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.
139148

140149
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:
141150

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).
143152
- 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).
144153

145154
**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
176185
OAS uses several known formats to define in fine detail the data type being used.
177186
However, to support documentation needs, the `format` property is an open `string`-valued property, and can have any value.
178187
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+
179190
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.
180191

181192
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
205216

206217
### <a name="richText"></a>Rich Text Formatting
207218
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+
209224

210225
### <a name="relativeReferences"></a>Relative References in URLs
211226

@@ -218,6 +233,11 @@ Relative references in CommonMark hyperlinks are resolved in their rendered cont
218233

219234
### Schema
220235

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+
221241
In the following description, if a field is not explicitly **REQUIRED** or described with a MUST or SHALL, it can be considered OPTIONAL.
222242

223243
#### <a name="oasObject"></a>OpenAPI Object
@@ -253,7 +273,7 @@ Field Name | Type | Description
253273
<a name="infoTermsOfService"></a>termsOfService | `string` | A URL to the Terms of Service for the API. MUST be in the format of a URL.
254274
<a name="infoContact"></a>contact | [Contact Object](#contactObject) | The contact information for the exposed API.
255275
<a name="infoLicense"></a>license | [License Object](#licenseObject) | The license information for the exposed API.
256-
<a name="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+
<a name="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).
257277

258278

259279
This object MAY be extended with [Specification Extensions](#specificationExtensions).
@@ -2002,6 +2022,11 @@ transactionCallback:
20022022

20032023
#### <a name="exampleObject"></a>Example Object
20042024

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+
20052030
##### Fixed Fields
20062031
Field Name | Type | Description
20072032
---|:---:|---
@@ -3094,7 +3119,8 @@ This object MAY be extended with [Specification Extensions](#specificationExtens
30943119

30953120
##### XML Object Examples
30963121

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.
30983124

30993125
###### No XML Element
31003126

@@ -3671,9 +3697,14 @@ The extensions properties are implemented as patterned fields that are always pr
36713697

36723698
Field Pattern | Type | Description
36733699
---|:---:|---
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.
36753706

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.
36773708

36783709
### <a name="securityFiltering"></a>Security Filtering
36793710

0 commit comments

Comments
 (0)