Skip to content

Commit a6b99bc

Browse files
MikeRalphsonwebron
andauthored
Make paths object optional (#1781)
* Make paths object optional * Adding reusable Path Item Objects Under `components` * Adopt DM's suggested change to OpenAPI doc definition * Cleanup use of specification and definition where we mean document * multipartite>composite, define ACL * Add ' | Reference Object' to callbacks/webhooks Co-authored-by: Ron <[email protected]>
1 parent 70ecce7 commit a6b99bc

File tree

1 file changed

+18
-15
lines changed

1 file changed

+18
-15
lines changed

versions/3.1.0.md

+18-15
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ An OpenAPI definition can then be used by documentation generation tools to disp
6868
## Definitions
6969

7070
##### <a name="oasDocument"></a>OpenAPI Document
71-
A document (or set of documents) that defines or describes an API. An OpenAPI definition uses and conforms to the OpenAPI Specification.
71+
A self-contained or composite resource which defines or describes an API or elements of an API. The OpenAPI document MUST contain at least one [paths](#pathsObject) field, a [components](#oasComponents) field or a [webhooks](#oasWebhooks) field. An OpenAPI document uses and conforms to the OpenAPI Specification.
7272

7373
##### <a name="pathTemplating"></a>Path Templating
7474
Path templating refers to the usage of curly braces ({}) to mark a section of a URL path as replaceable using path parameters.
@@ -183,7 +183,7 @@ In the following description, if a field is not explicitly **REQUIRED** or descr
183183

184184
#### <a name="oasObject"></a>OpenAPI Object
185185

186-
This is the root document object of the [OpenAPI document](#oasDocument).
186+
This is the root object of the [OpenAPI document](#oasDocument).
187187

188188
##### Fixed Fields
189189

@@ -192,11 +192,11 @@ Field Name | Type | Description
192192
<a name="oasVersion"></a>openapi | `string` | **REQUIRED**. This string MUST be the [semantic version number](https://semver.org/spec/v2.0.0.html) of the [OpenAPI Specification version](#versions) that the OpenAPI document uses. The `openapi` field SHOULD be used by tooling specifications and clients to interpret the OpenAPI document. This is *not* related to the API [`info.version`](#infoVersion) string.
193193
<a name="oasInfo"></a>info | [Info Object](#infoObject) | **REQUIRED**. Provides metadata about the API. The metadata MAY be used by tooling as required.
194194
<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 `/`.
195-
<a name="oasPaths"></a>paths | [Paths Object](#pathsObject) | **REQUIRED**. The available paths and operations for the API.
196-
<a name="oasWebhooks"></a>webhooks | Map[`string`, [Path Item Object](#pathItemObject)] | The incoming webhooks that MAY be received as part of this API and that the API consumer MAY choose to implement. Closely related to the `callbacks` feature, this section describes requests initiated other than by an API call, for example by an out of band registration. The key name is a unique string to refer to each webhook, while the Path Item Object describes a request that may be initiated by the API provider and the expected responses. An [example](../examples/v3.1/webhook-example.yaml) is available.
197-
<a name="oasComponents"></a>components | [Components Object](#componentsObject) | An element to hold various schemas for the specification.
195+
<a name="oasPaths"></a>paths | [Paths Object](#pathsObject) | The available paths and operations for the API.
196+
<a name="oasWebhooks"></a>webhooks | Map[`string`, [Path Item Object](#pathItemObject) \| [Reference Object](#referenceObject)] ] | The incoming webhooks that MAY be received as part of this API and that the API consumer MAY choose to implement. Closely related to the `callbacks` feature, this section describes requests initiated other than by an API call, for example by an out of band registration. The key name is a unique string to refer to each webhook, while the (optionally referenced) Path Item Object describes a request that may be initiated by the API provider and the expected responses. An [example](../examples/v3.1/webhook-example.yaml) is available.
197+
<a name="oasComponents"></a>components | [Components Object](#componentsObject) | An element to hold various schemas for the document.
198198
<a name="oasSecurity"></a>security | [[Security Requirement Object](#securityRequirementObject)] | A declaration of which security mechanisms can be used across the API. The list of values includes alternative security requirement objects that can be used. Only one of the security requirement objects need to be satisfied to authorize a request. Individual operations can override this definition.
199-
<a name="oasTags"></a>tags | [[Tag Object](#tagObject)] | A list of tags used by the specification with additional metadata. The order of the tags can be used to reflect on their order by the parsing tools. Not all tags that are used by the [Operation Object](#operationObject) must be declared. The tags that are not declared MAY be organized randomly or based on the tools' logic. Each tag name in the list MUST be unique.
199+
<a name="oasTags"></a>tags | [[Tag Object](#tagObject)] | A list of tags used by the document with additional metadata. The order of the tags can be used to reflect on their order by the parsing tools. Not all tags that are used by the [Operation Object](#operationObject) must be declared. The tags that are not declared MAY be organized randomly or based on the tools' logic. Each tag name in the list MUST be unique.
200200
<a name="oasExternalDocs"></a>externalDocs | [External Documentation Object](#externalDocumentationObject) | Additional external documentation.
201201

202202

@@ -459,6 +459,8 @@ Field Name | Type | Description
459459
<a name="componentsSecuritySchemes"></a> securitySchemes| Map[`string`, [Security Scheme Object](#securitySchemeObject) \| [Reference Object](#referenceObject)] | An object to hold reusable [Security Scheme Objects](#securitySchemeObject).
460460
<a name="componentsLinks"></a> links | Map[`string`, [Link Object](#linkObject) \| [Reference Object](#referenceObject)] | An object to hold reusable [Link Objects](#linkObject).
461461
<a name="componentsCallbacks"></a> callbacks | Map[`string`, [Callback Object](#callbackObject) \| [Reference Object](#referenceObject)] | An object to hold reusable [Callback Objects](#callbackObject).
462+
<a name="componentsPathItems"></a> pathItems | Map[`string`, [Path Item Object](#pathItemObject) \| [Reference Object](#referenceObject)] | An object to hold reusable [Path Item Object](#pathItemObject).
463+
462464

463465
This object MAY be extended with [Specification Extensions](#specificationExtensions).
464466

@@ -652,7 +654,7 @@ components:
652654
#### <a name="pathsObject"></a>Paths Object
653655

654656
Holds the relative paths to the individual endpoints and their operations.
655-
The path is appended to the URL from the [`Server Object`](#serverObject) in order to construct the full URL. The Paths MAY be empty, due to [ACL constraints](#securityFiltering).
657+
The path is appended to the URL from the [`Server Object`](#serverObject) in order to construct the full URL. The Paths MAY be empty, due to [Access Control List (ACL) constraints](#securityFiltering). Paths MAY be omitted in some classes of OAS documents, including referenced sub-documents and overlays.
656658

657659
##### Patterned Fields
658660

@@ -1642,10 +1644,11 @@ The documentation is not necessarily expected to cover all possible HTTP respons
16421644
However, documentation is expected to cover a successful operation response and any known errors.
16431645

16441646
The `default` MAY be used as a default response object for all HTTP codes
1645-
that are not covered individually by the specification.
1647+
that are not covered individually by the `Responses Object`.
16461648

1647-
The `Responses Object` MUST contain at least one response code, and it
1648-
SHOULD be the response for a successful operation call.
1649+
The `Responses Object` MUST contain at least one response code, and if only one
1650+
response code is provided it SHOULD be the response for a successful operation
1651+
call.
16491652

16501653
##### Fixed Fields
16511654
Field Name | Type | Description
@@ -1852,7 +1855,7 @@ To describe incoming requests from the API provider independent from another API
18521855
##### Patterned Fields
18531856
Field Pattern | Type | Description
18541857
---|:---:|---
1855-
<a name="callbackExpression"></a>{expression} | [Path Item Object](#pathItemObject) | A Path Item Object used to define a callback request and expected responses. A [complete example](../examples/v3.0/callback-example.yaml) is available.
1858+
<a name="callbackExpression"></a>{expression} | [Path Item Object](#pathItemObject) \| [Reference Object](#referenceObject) | A Path Item Object, or a reference to one, used to define a callback request and expected responses. A [complete example](../examples/v3.0/callback-example.yaml) is available.
18561859

18571860
This object MAY be extended with [Specification Extensions](#specificationExtensions).
18581861

@@ -2046,7 +2049,7 @@ This object MAY be extended with [Specification Extensions](#specificationExtens
20462049
A linked operation MUST be identified using either an `operationRef` or `operationId`.
20472050
In the case of an `operationId`, it MUST be unique and resolved in the scope of the OAS document.
20482051
Because of the potential for name clashes, the `operationRef` syntax is preferred
2049-
for specifications with external references.
2052+
for OpenAPI documents with external references.
20502053

20512054
##### Examples
20522055

@@ -2242,7 +2245,7 @@ description: Pets operations
22422245

22432246
#### <a name="referenceObject"></a>Reference Object
22442247

2245-
A simple object to allow referencing other components in the specification, internally and externally.
2248+
A simple object to allow referencing other components in the OpenAPI document, internally and externally.
22462249

22472250
##### Fixed Fields
22482251
Field Name | Type | Description
@@ -2670,7 +2673,7 @@ components:
26702673
26712674
#### <a name="discriminatorObject"></a>Discriminator Object
26722675
2673-
When request bodies or response payloads may be one of a number of different schemas, a `discriminator` object can be used to aid in serialization, deserialization, and validation. The discriminator is a specific object in a schema which is used to inform the consumer of the specification of an alternative schema based on the value associated with it.
2676+
When request bodies or response payloads may be one of a number of different schemas, a `discriminator` object can be used to aid in serialization, deserialization, and validation. The discriminator is a specific object in a schema which is used to inform the consumer of the document of an alternative schema based on the value associated with it.
26742677

26752678
When using the discriminator, _inline_ schemas will not be considered.
26762679

@@ -3389,7 +3392,7 @@ While not part of the specification itself, certain libraries MAY choose to allo
33893392

33903393
Two examples of this:
33913394

3392-
1. The [Paths Object](#pathsObject) MAY be empty. It may be counterintuitive, but this may tell the viewer that they got to the right place, but can't access any documentation. They'd still have access to the [Info Object](#infoObject) which may contain additional information regarding authentication.
3395+
1. The [Paths Object](#pathsObject) MAY be present but empty. It may be counterintuitive, but this may tell the viewer that they got to the right place, but can't access any documentation. They would still have access to at least the [Info Object](#infoObject) which may contain additional information regarding authentication.
33933396
2. The [Path Item Object](#pathItemObject) MAY be empty. In this case, the viewer will be aware that the path exists, but will not be able to see any of its operations or parameters. This is different than hiding the path itself from the [Paths Object](#pathsObject), so the user will not be aware of its existence. This allows the documentation provider to finely control what the viewer can see.
33943397

33953398
## <a name="revisionHistory"></a>Appendix A: Revision History

0 commit comments

Comments
 (0)