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.2.0.md
+19-3
Original file line number
Diff line number
Diff line change
@@ -360,13 +360,29 @@ Field Name | Type | Description
360
360
<aname="oasPaths"></a>paths | [Paths Object](#pathsObject) | The available paths and operations for the API.
361
361
<aname="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.
362
362
<aname="oasComponents"></a>components | [Components Object](#componentsObject) | An element to hold various schemas for the document.
363
-
<aname="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 thesecurity requirement objects need to be satisfied to authorize a request. Individual operations can override this definition. To make security optional, an empty security requirement (`{}`) can be included in the array.
363
+
<aname="oasSecurity"></a>security | [[Security Requirement Object](#securityRequirementObject)] | A declaration of which security mechanisms can be used across the API. See [The `security` Field](#the-security-field).
364
364
<aname="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.
This object MAY be extended with [Specification Extensions](#specificationExtensions).
369
369
370
+
###### The `security` Field
371
+
372
+
The `security` field describes which authentication mechanisms may be expected to be relevant for this API. This field, however, does not _define_ how authentication / authorization works for this API. Think of it more as _setting expectations_.
373
+
374
+
`security` may be specified at the [OpenAPI Object](#oasObject) level, or at the [Operation Object](#operationObject) level, or neither, or both. The effective value of `security` for a given operation is given by the first available of:
375
+
376
+
1. the `security` value given at the Operation level (if specified);
377
+
2. the `security` value given at the OpenAPI Object level (if specified);
378
+
3. the empty array (`[]`).
379
+
380
+
If the effective value of `security` is the empty array (`[]`), then nothing should be inferred about authentication / authorization for this API. Maybe credentials are required, maybe not; we just don't know.
381
+
382
+
Otherwise, `security` is a non-empty array of [Security Requirement Objects](#securityRequirementObject), and it should be inferred that at least one of these needs to be satisfied for the request to be accepted.
383
+
384
+
Because the empty Security Requirement Object `{}` will always be satisfied, any `security` list that includes the empty object (`{}`) may be inferred to allow all requests. In particular, `security: [{}]` is the RECOMMENDED way of saying "this API (or operation) does not require authentication".
385
+
370
386
#### <aname="infoObject"></a>Info Object
371
387
372
388
The object provides metadata about the API.
@@ -1021,7 +1037,7 @@ Field Name | Type | Description
1021
1037
<a name="operationResponses"></a>responses | [Responses Object](#responsesObject) | The list of possible responses as they are returned from executing this operation.
1022
1038
<a name="operationCallbacks"></a>callbacks | Map[`string`, [Callback Object](#callbackObject) \| [Reference Object](#referenceObject)] | A map of possible out-of band callbacks related to the parent operation. The key is a unique identifier for the Callback Object. Each value in the map is a [Callback Object](#callbackObject) that describes a request that may be initiated by the API provider and the expected responses.
1023
1039
<a name="operationDeprecated"></a>deprecated | `boolean` | Declares this operation to be deprecated. Consumers SHOULD refrain from usage of the declared operation. Default value is `false`.
1024
-
<a name="operationSecurity"></a>security | [[Security Requirement Object](#securityRequirementObject)] | A declaration of which security mechanisms can be used for this operation. 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. To make security optional, an empty security requirement (`{}`) can be included in the array. This definition overrides any declared top-level [`security`](#oasSecurity). To remove a top-level security declaration, an empty array can be used.
1040
+
<a name="operationSecurity"></a>security | [[Security Requirement Object](#securityRequirementObject)] | A declaration of which security mechanisms can be used for this operation. If present, then this overrides any `security` field specified at the [OpenAPI Object](#oasSecurity) level. See the [definition of that field](#the-security-field) for details.
1025
1041
<a name="operationServers"></a>servers | [[Server Object](#serverObject)] | An alternative `server` array to service this operation. If an alternative `server` object is specified at the Path Item Object or Root level, it will be overridden by this value.
1026
1042
1027
1043
This object MAY be extended with [Specification Extensions](#specificationExtensions).
@@ -3973,7 +3989,7 @@ The name used for each property MUST correspond to a security scheme declared in
3973
3989
Security Requirement Objects that contain multiple schemes require that all schemes MUST be satisfied for a request to be authorized.
3974
3990
This enables support for scenarios where multiple query parameters or HTTP headers are required to convey security information.
3975
3991
3976
-
When a list of Security Requirement Objects is defined on the [OpenAPI Object](#oasObject) or [Operation Object](#operationObject), only one of the Security Requirement Objects in the list needs to be satisfied to authorize the request.
3992
+
When a non-empty list of Security Requirement Objects is defined on the [OpenAPI Object](#oasObject) or [Operation Object](#operationObject), at least one of the Security Requirement Objects in the list needs to be satisfied for the request to be authorized; see [The `security` Field](#the-security-field).
0 commit comments