diff --git a/definitions/3.0.0/SecurityRequirement.json b/definitions/3.0.0/SecurityRequirement.json deleted file mode 100644 index 410afeb6..00000000 --- a/definitions/3.0.0/SecurityRequirement.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "type": "object", - "additionalProperties": { - "type": "array", - "items": { - "type": "string" - }, - "uniqueItems": true - }, - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://asyncapi.com/definitions/3.0.0/SecurityRequirement.json" -} \ No newline at end of file diff --git a/definitions/3.0.0/oauth2Flow.json b/definitions/3.0.0/oauth2Flow.json index f5a9e447..d3ca471b 100644 --- a/definitions/3.0.0/oauth2Flow.json +++ b/definitions/3.0.0/oauth2Flow.json @@ -13,7 +13,7 @@ "type": "string", "format": "uri" }, - "scopes": { + "availableScopes": { "$ref": "http://asyncapi.com/definitions/3.0.0/oauth2Scopes.json" } }, diff --git a/definitions/3.0.0/oauth2Flows.json b/definitions/3.0.0/oauth2Flows.json index bb895f28..735806c8 100644 --- a/definitions/3.0.0/oauth2Flows.json +++ b/definitions/3.0.0/oauth2Flows.json @@ -25,7 +25,7 @@ { "required": [ "authorizationUrl", - "scopes" + "availableScopes" ] }, { @@ -45,7 +45,7 @@ { "required": [ "tokenUrl", - "scopes" + "availableScopes" ] }, { @@ -65,7 +65,7 @@ { "required": [ "tokenUrl", - "scopes" + "availableScopes" ] }, { @@ -86,13 +86,20 @@ "required": [ "authorizationUrl", "tokenUrl", - "scopes" + "availableScopes" ] } ] } }, "additionalProperties": false + }, + "scopes": { + "type": "array", + "description": "List of the needed scope names.", + "items": { + "type": "string" + } } }, "patternProperties": { diff --git a/definitions/3.0.0/openIdConnect.json b/definitions/3.0.0/openIdConnect.json index 4d034031..2150ba4d 100644 --- a/definitions/3.0.0/openIdConnect.json +++ b/definitions/3.0.0/openIdConnect.json @@ -17,6 +17,13 @@ "openIdConnectUrl": { "type": "string", "format": "uri" + }, + "scopes": { + "type": "array", + "description": "List of the needed scope names.", + "items": { + "type": "string" + } } }, "patternProperties": { diff --git a/definitions/3.0.0/operation.json b/definitions/3.0.0/operation.json index bd99aa68..a8d00ad2 100644 --- a/definitions/3.0.0/operation.json +++ b/definitions/3.0.0/operation.json @@ -64,10 +64,7 @@ "description": "A longer description of the operation. CommonMark is allowed." }, "security": { - "type": "array", - "items": { - "$ref": "http://asyncapi.com/definitions/3.0.0/SecurityRequirement.json" - } + "$ref": "http://asyncapi.com/definitions/3.0.0/securityRequirements.json" }, "tags": { "type": "array", diff --git a/definitions/3.0.0/securityRequirements.json b/definitions/3.0.0/securityRequirements.json new file mode 100644 index 00000000..b8da3dcb --- /dev/null +++ b/definitions/3.0.0/securityRequirements.json @@ -0,0 +1,16 @@ +{ + "description": "An array representing security requirements.", + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/SecurityScheme.json" + } + ] + }, + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/definitions/3.0.0/securityRequirements.json" +} diff --git a/definitions/3.0.0/server.json b/definitions/3.0.0/server.json index 5b4fbb4e..5da34f82 100644 --- a/definitions/3.0.0/server.json +++ b/definitions/3.0.0/server.json @@ -38,10 +38,7 @@ "$ref": "http://asyncapi.com/definitions/3.0.0/serverVariables.json" }, "security": { - "type": "array", - "items": { - "$ref": "http://asyncapi.com/definitions/3.0.0/SecurityRequirement.json" - } + "$ref": "http://asyncapi.com/definitions/3.0.0/securityRequirements.json" }, "bindings": { "$ref": "http://asyncapi.com/definitions/3.0.0/serverBindingsObject.json"