From f1f60f5aabf1d683ad3d34db418f67e62400c9d6 Mon Sep 17 00:00:00 2001 From: arcturusZhang Date: Tue, 13 Oct 2020 11:10:02 +0800 Subject: [PATCH 1/4] Fix problematic inherintance structure --- .../preview/2017-08-01-preview/settings.json | 21 +++++-------------- .../stable/2019-01-01/settings.json | 20 +++++------------- 2 files changed, 10 insertions(+), 31 deletions(-) diff --git a/specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/settings.json b/specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/settings.json index 31f72a422d9b..279809720b1a 100644 --- a/specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/settings.json +++ b/specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/settings.json @@ -100,7 +100,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/Setting" + "$ref": "#/definitions/SettingResource" } }, "default": { @@ -140,7 +140,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/Setting" + "$ref": "#/definitions/SettingResource" } }, "default": { @@ -162,7 +162,7 @@ "type": "array", "description": "The settings list.", "items": { - "$ref": "#/definitions/Setting" + "$ref": "#/definitions/SettingResource" } }, "nextLink": { @@ -172,17 +172,6 @@ } } }, - "Setting": { - "type": "object", - "description": "Represents a security setting in Azure Security Center.", - "discriminator": "kind", - "properties": {}, - "allOf": [ - { - "$ref": "#/definitions/SettingResource" - } - ] - }, "DataExportSetting": { "type": "object", "description": "Represents a data export setting", @@ -196,7 +185,7 @@ }, "allOf": [ { - "$ref": "#/definitions/Setting" + "$ref": "#/definitions/SettingResource" } ] }, @@ -267,7 +256,7 @@ "required": true, "description": "Setting object", "schema": { - "$ref": "#/definitions/Setting" + "$ref": "#/definitions/SettingResource" }, "x-ms-parameter-location": "method" } diff --git a/specification/security/resource-manager/Microsoft.Security/stable/2019-01-01/settings.json b/specification/security/resource-manager/Microsoft.Security/stable/2019-01-01/settings.json index e408c16ecaa8..387dfb128e69 100644 --- a/specification/security/resource-manager/Microsoft.Security/stable/2019-01-01/settings.json +++ b/specification/security/resource-manager/Microsoft.Security/stable/2019-01-01/settings.json @@ -100,7 +100,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/Setting" + "$ref": "#/definitions/SettingResource" } }, "default": { @@ -140,7 +140,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/Setting" + "$ref": "#/definitions/SettingResource" } }, "default": { @@ -162,7 +162,7 @@ "type": "array", "description": "The settings list.", "items": { - "$ref": "#/definitions/Setting" + "$ref": "#/definitions/SettingResource" } }, "nextLink": { @@ -172,16 +172,6 @@ } } }, - "Setting": { - "type": "object", - "description": "Represents a security setting in Azure Security Center.", - "properties": {}, - "allOf": [ - { - "$ref": "#/definitions/SettingResource" - } - ] - }, "DataExportSettings": { "type": "object", "description": "Represents a data export setting", @@ -194,7 +184,7 @@ }, "allOf": [ { - "$ref": "#/definitions/Setting" + "$ref": "#/definitions/SettingResource" } ], "x-ms-discriminator-value": "DataExportSettings" @@ -267,7 +257,7 @@ "required": true, "description": "Setting object", "schema": { - "$ref": "#/definitions/Setting" + "$ref": "#/definitions/SettingResource" }, "x-ms-parameter-location": "method" } From 216faa98444463beaae1271ce203cac5c0f84c1f Mon Sep 17 00:00:00 2001 From: arcturusZhang Date: Tue, 13 Oct 2020 11:21:28 +0800 Subject: [PATCH 2/4] Add back the missing discriminator --- .../Microsoft.Security/preview/2017-08-01-preview/settings.json | 1 + 1 file changed, 1 insertion(+) diff --git a/specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/settings.json b/specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/settings.json index 279809720b1a..8efbf754a7e1 100644 --- a/specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/settings.json +++ b/specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/settings.json @@ -214,6 +214,7 @@ } } }, + "discriminator": "kind", "required": [ "kind" ], From 803d2ebdce46839c5a73c3b11bfcff77c47c0509 Mon Sep 17 00:00:00 2001 From: arcturusZhang Date: Tue, 13 Oct 2020 11:25:03 +0800 Subject: [PATCH 3/4] Fix examples --- .../examples/Settings/UpdateSetting_example.json | 3 --- 1 file changed, 3 deletions(-) diff --git a/specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/Settings/UpdateSetting_example.json b/specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/Settings/UpdateSetting_example.json index e9815a163a4d..4f4527c41b41 100644 --- a/specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/Settings/UpdateSetting_example.json +++ b/specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/Settings/UpdateSetting_example.json @@ -4,10 +4,7 @@ "subscriptionId": "20ff7fc3-e762-44dd-bd96-b71116dcdc23", "settingName": "MCAS", "setting": { - "id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/settings/MCAS", - "name": "MCAS", "kind": "DataExportSetting", - "type": "Microsoft.Security/settings", "properties": { "enabled": true } From e40fb021db7713b24d02e2880d139b6570bcd866 Mon Sep 17 00:00:00 2001 From: arcturusZhang Date: Fri, 16 Oct 2020 16:51:33 +0800 Subject: [PATCH 4/4] rename model --- .../preview/2017-08-01-preview/settings.json | 12 ++++++------ .../stable/2019-01-01/settings.json | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/settings.json b/specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/settings.json index 8efbf754a7e1..e46970bbbadf 100644 --- a/specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/settings.json +++ b/specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/settings.json @@ -100,7 +100,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/SettingResource" + "$ref": "#/definitions/Setting" } }, "default": { @@ -140,7 +140,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/SettingResource" + "$ref": "#/definitions/Setting" } }, "default": { @@ -162,7 +162,7 @@ "type": "array", "description": "The settings list.", "items": { - "$ref": "#/definitions/SettingResource" + "$ref": "#/definitions/Setting" } }, "nextLink": { @@ -185,11 +185,11 @@ }, "allOf": [ { - "$ref": "#/definitions/SettingResource" + "$ref": "#/definitions/Setting" } ] }, - "SettingResource": { + "Setting": { "type": "object", "description": "The kind of the security setting", "properties": { @@ -257,7 +257,7 @@ "required": true, "description": "Setting object", "schema": { - "$ref": "#/definitions/SettingResource" + "$ref": "#/definitions/Setting" }, "x-ms-parameter-location": "method" } diff --git a/specification/security/resource-manager/Microsoft.Security/stable/2019-01-01/settings.json b/specification/security/resource-manager/Microsoft.Security/stable/2019-01-01/settings.json index 387dfb128e69..d30d34b8cb55 100644 --- a/specification/security/resource-manager/Microsoft.Security/stable/2019-01-01/settings.json +++ b/specification/security/resource-manager/Microsoft.Security/stable/2019-01-01/settings.json @@ -100,7 +100,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/SettingResource" + "$ref": "#/definitions/Setting" } }, "default": { @@ -140,7 +140,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/SettingResource" + "$ref": "#/definitions/Setting" } }, "default": { @@ -162,7 +162,7 @@ "type": "array", "description": "The settings list.", "items": { - "$ref": "#/definitions/SettingResource" + "$ref": "#/definitions/Setting" } }, "nextLink": { @@ -184,12 +184,12 @@ }, "allOf": [ { - "$ref": "#/definitions/SettingResource" + "$ref": "#/definitions/Setting" } ], "x-ms-discriminator-value": "DataExportSettings" }, - "SettingResource": { + "Setting": { "type": "object", "description": "The kind of the security setting", "properties": { @@ -257,7 +257,7 @@ "required": true, "description": "Setting object", "schema": { - "$ref": "#/definitions/SettingResource" + "$ref": "#/definitions/Setting" }, "x-ms-parameter-location": "method" }