diff --git a/specification/storage/resource-manager/Microsoft.Storage/stable/2019-06-01/blob.json b/specification/storage/resource-manager/Microsoft.Storage/stable/2019-06-01/blob.json index c699317de8db..d8378f857e7a 100644 --- a/specification/storage/resource-manager/Microsoft.Storage/stable/2019-06-01/blob.json +++ b/specification/storage/resource-manager/Microsoft.Storage/stable/2019-06-01/blob.json @@ -1130,7 +1130,7 @@ "properties": { "properties": { "cors": { - "$ref": "#/definitions/CorsRules", + "$ref": "./common.json#/definitions/CorsRules", "description": "Specifies CORS rules for the Blob service. You can include up to five CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for the Blob service." }, "defaultServiceVersion": { @@ -1198,72 +1198,6 @@ }, "description": "The blob service properties for soft delete." }, - "CorsRules": { - "properties": { - "corsRules": { - "type": "array", - "items": { - "description": "Specifies a CORS rule for the Blob service. ", - "$ref": "#/definitions/CorsRule" - }, - "description": "The List of CORS rules. You can include up to five CorsRule elements in the request. " - } - }, - "description": "Sets the CORS rules. You can include up to five CorsRule elements in the request. " - }, - "CorsRule": { - "properties": { - "allowedOrigins": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Required if CorsRule element is present. A list of origin domains that will be allowed via CORS, or \"*\" to allow all domains" - }, - "allowedMethods": { - "type": "array", - "items": { - "type": "string", - "enum": [ - "DELETE", - "GET", - "HEAD", - "MERGE", - "POST", - "OPTIONS", - "PUT" - ] - }, - "description": "Required if CorsRule element is present. A list of HTTP methods that are allowed to be executed by the origin." - }, - "maxAgeInSeconds": { - "type": "integer", - "description": "Required if CorsRule element is present. The number of seconds that the client/browser should cache a preflight response." - }, - "exposedHeaders": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Required if CorsRule element is present. A list of response headers to expose to CORS clients." - }, - "allowedHeaders": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Required if CorsRule element is present. A list of headers allowed to be part of the cross-origin request." - } - }, - "required": [ - "allowedOrigins", - "allowedMethods", - "maxAgeInSeconds", - "exposedHeaders", - "allowedHeaders" - ], - "description": "Specifies a CORS rule for the Blob service." - }, "LeaseContainerRequest": { "properties": { "action": { diff --git a/specification/storage/resource-manager/Microsoft.Storage/stable/2019-06-01/common.json b/specification/storage/resource-manager/Microsoft.Storage/stable/2019-06-01/common.json new file mode 100644 index 000000000000..d3734f098d55 --- /dev/null +++ b/specification/storage/resource-manager/Microsoft.Storage/stable/2019-06-01/common.json @@ -0,0 +1,76 @@ +{ + "swagger": "2.0", + "info": { + "title": "Storage", + "description": "Storage Resource Provider API Common Types", + "version": "2019-06-01" + }, + "definitions": { + "CorsRules": { + "properties": { + "corsRules": { + "type": "array", + "items": { + "description": "Specifies a CORS rule for the Blob service. ", + "$ref": "#/definitions/CorsRule" + }, + "description": "The List of CORS rules. You can include up to five CorsRule elements in the request. " + } + }, + "description": "Sets the CORS rules. You can include up to five CorsRule elements in the request. " + }, + "CorsRule": { + "properties": { + "allowedOrigins": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Required if CorsRule element is present. A list of origin domains that will be allowed via CORS, or \"*\" to allow all domains" + }, + "allowedMethods": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "DELETE", + "GET", + "HEAD", + "MERGE", + "POST", + "OPTIONS", + "PUT" + ] + }, + "description": "Required if CorsRule element is present. A list of HTTP methods that are allowed to be executed by the origin." + }, + "maxAgeInSeconds": { + "type": "integer", + "description": "Required if CorsRule element is present. The number of seconds that the client/browser should cache a preflight response." + }, + "exposedHeaders": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Required if CorsRule element is present. A list of response headers to expose to CORS clients." + }, + "allowedHeaders": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Required if CorsRule element is present. A list of headers allowed to be part of the cross-origin request." + } + }, + "required": [ + "allowedOrigins", + "allowedMethods", + "maxAgeInSeconds", + "exposedHeaders", + "allowedHeaders" + ], + "description": "Specifies a CORS rule for the Blob service." + } + } +} diff --git a/specification/storage/resource-manager/Microsoft.Storage/stable/2019-06-01/file.json b/specification/storage/resource-manager/Microsoft.Storage/stable/2019-06-01/file.json index 8c1500e04729..13544c308b22 100644 --- a/specification/storage/resource-manager/Microsoft.Storage/stable/2019-06-01/file.json +++ b/specification/storage/resource-manager/Microsoft.Storage/stable/2019-06-01/file.json @@ -436,7 +436,7 @@ "properties": { "properties": { "cors": { - "$ref": "../../../../../storage/resource-manager/Microsoft.Storage/stable/2019-06-01/blob.json#/definitions/CorsRules", + "$ref": "./common.json#/definitions/CorsRules", "description": "Specifies CORS rules for the File service. You can include up to five CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for the File service." } },