From 2fa56c08b0fa790a0eb7a776b3156b951dba8a05 Mon Sep 17 00:00:00 2001 From: Fred Ross Date: Tue, 2 Mar 2021 13:51:36 -0800 Subject: [PATCH 1/4] Fix parent class of ClusterResource and DataCenterResource in .NET SDK Removed x-ms-azure-resource from ClusterResource and DataCenterResource. x-ms-azure-resource is already set on the ProxyResource and TrackedResource definitions that ClusterResource and DataCenterResource, and when it's applied it on ClusterResource or DataCenterResource directly, it forces the parent class to be IResource in the .NET SDK and loses the location, type, id, etc. parameters. --- .../2021-03-01-preview/managedCassandra.json | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2021-03-01-preview/managedCassandra.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2021-03-01-preview/managedCassandra.json index 2427fbdf349d..786e0fe8c7b0 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2021-03-01-preview/managedCassandra.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2021-03-01-preview/managedCassandra.json @@ -771,15 +771,15 @@ }, "ClusterResource": { "description": "Representation of a managed Cassandra cluster.", - "x-ms-azure-resource": true, "type": "object", "allOf": [ { - "$ref": "cosmos-db.json#/definitions/ARMResourceProperties" + "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/TrackedResource" } ], "properties": { "properties": { + "x-ms-client-flatten": true, "type": "object", "description": "Properties of a managed Cassandra cluster.", "properties": { @@ -888,7 +888,10 @@ } } } - } + }, + "required": [ + "properties" + ] }, "RepairPostBody": { "description": "Specification of the keyspaces and tables to run repair on.", @@ -1056,7 +1059,6 @@ "DataCenterResource": { "description": "A managed Cassandra data center.", "type": "object", - "x-ms-azure-resource": true, "allOf": [ { "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ProxyResource" @@ -1064,6 +1066,7 @@ ], "properties": { "properties": { + "x-ms-client-flatten": true, "description": "Properties of a managed Cassandra data center.", "type": "object", "properties": { @@ -1105,7 +1108,10 @@ } } } - } + }, + "required": [ + "properties" + ] } } } From 519bab0f04362ca9b301869b85b068598fa56e12 Mon Sep 17 00:00:00 2001 From: Fred Ross Date: Tue, 2 Mar 2021 14:50:16 -0800 Subject: [PATCH 2/4] Switched to CosmosDB's ARM resource parents. The types.json ones throw errors. In particular, I can't use TrackedResource because it sets location to be required, and the same field is not found by the linter. --- .../preview/2021-03-01-preview/managedCassandra.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2021-03-01-preview/managedCassandra.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2021-03-01-preview/managedCassandra.json index 786e0fe8c7b0..ae61491056aa 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2021-03-01-preview/managedCassandra.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2021-03-01-preview/managedCassandra.json @@ -774,7 +774,7 @@ "type": "object", "allOf": [ { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/TrackedResource" + "$ref": "cosmos-db.json#/definitions/ARMResourceProperties" } ], "properties": { @@ -994,7 +994,7 @@ "type": "object", "allOf": [ { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ProxyResource" + "$ref": "cosmos-db.json#/definitions/ARMProxyResource" } ], "properties": { @@ -1061,7 +1061,7 @@ "type": "object", "allOf": [ { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ProxyResource" + "$ref": "cosmos-db.json#/definitions/ARMProxyResource" } ], "properties": { From 73e0f479f37a8a94037658c76f99b77e03525d15 Mon Sep 17 00:00:00 2001 From: Fred Ross Date: Tue, 2 Mar 2021 16:14:25 -0800 Subject: [PATCH 3/4] Remove required properties since they are forbidden for PATCH. --- .../preview/2021-03-01-preview/managedCassandra.json | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2021-03-01-preview/managedCassandra.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2021-03-01-preview/managedCassandra.json index ae61491056aa..6b52a4a124b4 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2021-03-01-preview/managedCassandra.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2021-03-01-preview/managedCassandra.json @@ -888,10 +888,7 @@ } } } - }, - "required": [ - "properties" - ] + } }, "RepairPostBody": { "description": "Specification of the keyspaces and tables to run repair on.", @@ -1108,10 +1105,7 @@ } } } - }, - "required": [ - "properties" - ] + } } } } From c3617fa5f4622c1d88b8987a316afedb039858da Mon Sep 17 00:00:00 2001 From: Fred Ross Date: Tue, 2 Mar 2021 17:50:26 -0800 Subject: [PATCH 4/4] Remove x-ms-client-flatten to avoid breaking changes. --- .../preview/2021-03-01-preview/managedCassandra.json | 2 -- 1 file changed, 2 deletions(-) diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2021-03-01-preview/managedCassandra.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2021-03-01-preview/managedCassandra.json index 6b52a4a124b4..e92d963c7d24 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2021-03-01-preview/managedCassandra.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2021-03-01-preview/managedCassandra.json @@ -779,7 +779,6 @@ ], "properties": { "properties": { - "x-ms-client-flatten": true, "type": "object", "description": "Properties of a managed Cassandra cluster.", "properties": { @@ -1063,7 +1062,6 @@ ], "properties": { "properties": { - "x-ms-client-flatten": true, "description": "Properties of a managed Cassandra data center.", "type": "object", "properties": {