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
Referencing issue OAI#513. Clarify the spec to accommodate OAuth schemes where scope may be unspecified (optional scope) or where scope is not used at all.
Copy file name to clipboardExpand all lines: versions/3.0.3.md
+39-2Lines changed: 39 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -3286,12 +3286,14 @@ Field Name | Type | Applies To | Description
3286
3286
<a name="oauthFlowAuthorizationUrl"></a>authorizationUrl | `string` | `oauth2` (`"implicit"`, `"authorizationCode"`) | **REQUIRED**. The authorization URL to be used for this flow. This MUST be in the form of a URL.
3287
3287
<a name="oauthFlowTokenUrl"></a>tokenUrl | `string` | `oauth2` (`"password"`, `"clientCredentials"`, `"authorizationCode"`) | **REQUIRED**. The token URL to be used for this flow. This MUST be in the form of a URL.
3288
3288
<a name="oauthFlowRefreshUrl"></a>refreshUrl | `string` | `oauth2` | The URL to be used for obtaining refresh tokens. This MUST be in the form of a URL.
3289
-
<a name="oauthFlowScopes"></a>scopes | Map[`string`, `string`] | `oauth2` | **REQUIRED**. The available scopes for the OAuth2 security scheme. A map between the scope name and a short description for it.
3289
+
<a name="oauthFlowScopes"></a>scopes | Map[`string`, `string`] | `oauth2` | **REQUIRED**. The available scopes for the OAuth2 security scheme. A map between the scope name and a short description for it. If scope is optional, the map MAY include an entry with an empty string as its key to represent the default scope. If scope is not used in the authorization scheme, the map MAY be empty.
3290
3290
3291
3291
This object MAY be extended with [Specification Extensions](#specificationExtensions).
3292
3292
3293
3293
##### OAuth Flow Object Examples
3294
3294
3295
+
###### OAuth Flows with Required Scope
3296
+
3295
3297
```JSON
3296
3298
{
3297
3299
"type": "oauth2",
@@ -3331,6 +3333,41 @@ flows:
3331
3333
read:pets: read your pets
3332
3334
```
3333
3335
3336
+
###### OAuth Flows with Unspecified and Optional Scope
@@ -3346,7 +3383,7 @@ When a list of Security Requirement Objects is defined on the [OpenAPI Object](#
3346
3383
3347
3384
Field Pattern | Type | Description
3348
3385
---|:---:|---
3349
-
<a name="securityRequirementsName"></a>{name} | [`string`] | Each name MUST correspond to a security scheme which is declared in the [Security Schemes](#componentsSecuritySchemes) under the [Components Object](#componentsObject). If the security scheme is of type `"oauth2"` or `"openIdConnect"`, then the value is a list of scope names required for the execution. For other security scheme types, the array MUST be empty.
3386
+
<a name="securityRequirementsName"></a>{name} | [`string`] | Each name MUST correspond to a security scheme which is declared in the [Security Schemes](#componentsSecuritySchemes) under the [Components Object](#componentsObject). If the security scheme is of type `"oauth2"` or `"openIdConnect"`, then the value is a list of scope names required for the execution, and the list MAY be empty if authorization does not require a specified scope. For other security scheme types, the array MUST be empty.
0 commit comments