diff --git a/.chronus/changes/res-vis-2024-5-12-4-34-46.md b/.chronus/changes/res-vis-2024-5-12-4-34-46.md new file mode 100644 index 0000000000..a5b220fe19 --- /dev/null +++ b/.chronus/changes/res-vis-2024-5-12-4-34-46.md @@ -0,0 +1,8 @@ +--- +# Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking +changeKind: fix +packages: + - "@azure-tools/typespec-azure-resource-manager" +--- + +Make Resource Properties Bag Updatable diff --git a/packages/samples/test/output/azure/resource-manager/arm-library/@azure-tools/typespec-autorest/openapi.json b/packages/samples/test/output/azure/resource-manager/arm-library/@azure-tools/typespec-autorest/openapi.json index c51ac0ef33..bc2f3ddd5f 100644 --- a/packages/samples/test/output/azure/resource-manager/arm-library/@azure-tools/typespec-autorest/openapi.json +++ b/packages/samples/test/output/azure/resource-manager/arm-library/@azure-tools/typespec-autorest/openapi.json @@ -1660,11 +1660,7 @@ "properties": { "$ref": "#/definitions/AllPropertiesProperties", "description": "The resource-specific properties for this resource.", - "x-ms-client-flatten": true, - "x-ms-mutability": [ - "read", - "create" - ] + "x-ms-client-flatten": true }, "eTag": { "type": "string", @@ -1822,11 +1818,7 @@ "properties": { "$ref": "#/definitions/Microsoft.InterfacesTest.TestExtensionProperties", "description": "The resource-specific properties for this resource.", - "x-ms-client-flatten": true, - "x-ms-mutability": [ - "read", - "create" - ] + "x-ms-client-flatten": true } }, "allOf": [ @@ -1858,11 +1850,7 @@ "properties": { "$ref": "#/definitions/Microsoft.InterfacesTest.TestTenantProperties", "description": "The resource-specific properties for this resource.", - "x-ms-client-flatten": true, - "x-ms-mutability": [ - "read", - "create" - ] + "x-ms-client-flatten": true } }, "allOf": [ @@ -1878,11 +1866,7 @@ "properties": { "$ref": "#/definitions/Microsoft.InterfacesTest.TrackedChildProperties", "description": "The resource-specific properties for this resource.", - "x-ms-client-flatten": true, - "x-ms-mutability": [ - "read", - "create" - ] + "x-ms-client-flatten": true } }, "allOf": [ @@ -1918,11 +1902,7 @@ "properties": { "$ref": "#/definitions/Microsoft.InterfacesTest.TestTrackedProperties", "description": "The resource-specific properties for this resource.", - "x-ms-client-flatten": true, - "x-ms-mutability": [ - "read", - "create" - ] + "x-ms-client-flatten": true } }, "allOf": [ @@ -1972,11 +1952,7 @@ "properties": { "$ref": "#/definitions/Microsoft.OperationsTest.TestTrackedProperties2", "description": "The resource-specific properties for this resource.", - "x-ms-client-flatten": true, - "x-ms-mutability": [ - "read", - "create" - ] + "x-ms-client-flatten": true } }, "allOf": [ diff --git a/packages/samples/test/output/azure/resource-manager/contoso/@azure-tools/typespec-autorest/openapi.json b/packages/samples/test/output/azure/resource-manager/contoso/@azure-tools/typespec-autorest/openapi.json index 26f450a967..31b260c10d 100644 --- a/packages/samples/test/output/azure/resource-manager/contoso/@azure-tools/typespec-autorest/openapi.json +++ b/packages/samples/test/output/azure/resource-manager/contoso/@azure-tools/typespec-autorest/openapi.json @@ -377,11 +377,7 @@ "properties": { "$ref": "#/definitions/EmployeeProperties", "description": "The resource-specific properties for this resource.", - "x-ms-client-flatten": true, - "x-ms-mutability": [ - "read", - "create" - ] + "x-ms-client-flatten": true } }, "allOf": [ diff --git a/packages/samples/test/output/azure/resource-manager/operations/nobody-action/@azure-tools/typespec-autorest/2021-10-01-preview/openapi.json b/packages/samples/test/output/azure/resource-manager/operations/nobody-action/@azure-tools/typespec-autorest/2021-10-01-preview/openapi.json index 8f2c907e51..daecccb955 100644 --- a/packages/samples/test/output/azure/resource-manager/operations/nobody-action/@azure-tools/typespec-autorest/2021-10-01-preview/openapi.json +++ b/packages/samples/test/output/azure/resource-manager/operations/nobody-action/@azure-tools/typespec-autorest/2021-10-01-preview/openapi.json @@ -588,11 +588,7 @@ "properties": { "$ref": "#/definitions/EmployeeProperties", "description": "The resource-specific properties for this resource.", - "x-ms-client-flatten": true, - "x-ms-mutability": [ - "read", - "create" - ] + "x-ms-client-flatten": true } }, "allOf": [ diff --git a/packages/samples/test/output/azure/resource-manager/resource-common-properties/common-properties/@azure-tools/typespec-autorest/2023-03-01-preview/openapi.json b/packages/samples/test/output/azure/resource-manager/resource-common-properties/common-properties/@azure-tools/typespec-autorest/2023-03-01-preview/openapi.json index 55c9e6e16d..22d4543ac4 100644 --- a/packages/samples/test/output/azure/resource-manager/resource-common-properties/common-properties/@azure-tools/typespec-autorest/2023-03-01-preview/openapi.json +++ b/packages/samples/test/output/azure/resource-manager/resource-common-properties/common-properties/@azure-tools/typespec-autorest/2023-03-01-preview/openapi.json @@ -447,11 +447,7 @@ "properties": { "$ref": "#/definitions/WidgetResourceProperties", "description": "The resource-specific properties for this resource.", - "x-ms-client-flatten": true, - "x-ms-mutability": [ - "read", - "create" - ] + "x-ms-client-flatten": true }, "extendedLocation": { "$ref": "#/definitions/Azure.ResourceManager.CommonTypes.ExtendedLocation", diff --git a/packages/samples/test/output/azure/resource-manager/resource-common-properties/encryption/@azure-tools/typespec-autorest/2023-03-01-preview/openapi.json b/packages/samples/test/output/azure/resource-manager/resource-common-properties/encryption/@azure-tools/typespec-autorest/2023-03-01-preview/openapi.json index 49b6327cae..c31a6041a9 100644 --- a/packages/samples/test/output/azure/resource-manager/resource-common-properties/encryption/@azure-tools/typespec-autorest/2023-03-01-preview/openapi.json +++ b/packages/samples/test/output/azure/resource-manager/resource-common-properties/encryption/@azure-tools/typespec-autorest/2023-03-01-preview/openapi.json @@ -405,11 +405,7 @@ "properties": { "$ref": "#/definitions/WidgetResourceProperties", "description": "The resource-specific properties for this resource.", - "x-ms-client-flatten": true, - "x-ms-mutability": [ - "read", - "create" - ] + "x-ms-client-flatten": true } }, "allOf": [ diff --git a/packages/samples/test/output/azure/resource-manager/resource-common-properties/managed-identity/@azure-tools/typespec-autorest/2023-03-01-preview/openapi.json b/packages/samples/test/output/azure/resource-manager/resource-common-properties/managed-identity/@azure-tools/typespec-autorest/2023-03-01-preview/openapi.json index f90ff76fb9..a476b4b43c 100644 --- a/packages/samples/test/output/azure/resource-manager/resource-common-properties/managed-identity/@azure-tools/typespec-autorest/2023-03-01-preview/openapi.json +++ b/packages/samples/test/output/azure/resource-manager/resource-common-properties/managed-identity/@azure-tools/typespec-autorest/2023-03-01-preview/openapi.json @@ -405,11 +405,7 @@ "properties": { "$ref": "#/definitions/WidgetResourceProperties", "description": "The resource-specific properties for this resource.", - "x-ms-client-flatten": true, - "x-ms-mutability": [ - "read", - "create" - ] + "x-ms-client-flatten": true }, "identity": { "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/managedidentity.json#/definitions/ManagedServiceIdentity", diff --git a/packages/samples/test/output/azure/resource-manager/resource-common-properties/private-links/@azure-tools/typespec-autorest/2023-08-01-preview/openapi.json b/packages/samples/test/output/azure/resource-manager/resource-common-properties/private-links/@azure-tools/typespec-autorest/2023-08-01-preview/openapi.json index 260e62648b..410346aa0f 100644 --- a/packages/samples/test/output/azure/resource-manager/resource-common-properties/private-links/@azure-tools/typespec-autorest/2023-08-01-preview/openapi.json +++ b/packages/samples/test/output/azure/resource-manager/resource-common-properties/private-links/@azure-tools/typespec-autorest/2023-08-01-preview/openapi.json @@ -649,11 +649,7 @@ "properties": { "$ref": "../../../../../../../../../specs/resource-manager/common-types/v4/privatelinks.json#/definitions/PrivateEndpointConnectionProperties", "description": "The resource-specific properties for this resource.", - "x-ms-client-flatten": true, - "x-ms-mutability": [ - "read", - "create" - ] + "x-ms-client-flatten": true } }, "allOf": [ @@ -690,11 +686,7 @@ "properties": { "$ref": "../../../../../../../../../specs/resource-manager/common-types/v4/privatelinks.json#/definitions/PrivateLinkResourceProperties", "description": "The resource-specific properties for this resource.", - "x-ms-client-flatten": true, - "x-ms-mutability": [ - "read", - "create" - ] + "x-ms-client-flatten": true } }, "allOf": [ @@ -759,11 +751,7 @@ "properties": { "$ref": "#/definitions/TestTrackedProperties", "description": "The resource-specific properties for this resource.", - "x-ms-client-flatten": true, - "x-ms-mutability": [ - "read", - "create" - ] + "x-ms-client-flatten": true } }, "allOf": [ diff --git a/packages/samples/test/output/azure/resource-manager/resource-common-properties/private-links/@azure-tools/typespec-autorest/2023-11-01-preview/openapi.json b/packages/samples/test/output/azure/resource-manager/resource-common-properties/private-links/@azure-tools/typespec-autorest/2023-11-01-preview/openapi.json index dd52faa934..4645f79a80 100644 --- a/packages/samples/test/output/azure/resource-manager/resource-common-properties/private-links/@azure-tools/typespec-autorest/2023-11-01-preview/openapi.json +++ b/packages/samples/test/output/azure/resource-manager/resource-common-properties/private-links/@azure-tools/typespec-autorest/2023-11-01-preview/openapi.json @@ -649,11 +649,7 @@ "properties": { "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/privatelinks.json#/definitions/PrivateEndpointConnectionProperties", "description": "The resource-specific properties for this resource.", - "x-ms-client-flatten": true, - "x-ms-mutability": [ - "read", - "create" - ] + "x-ms-client-flatten": true } }, "allOf": [ @@ -690,11 +686,7 @@ "properties": { "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/privatelinks.json#/definitions/PrivateLinkResourceProperties", "description": "The resource-specific properties for this resource.", - "x-ms-client-flatten": true, - "x-ms-mutability": [ - "read", - "create" - ] + "x-ms-client-flatten": true } }, "allOf": [ @@ -759,11 +751,7 @@ "properties": { "$ref": "#/definitions/TestTrackedProperties", "description": "The resource-specific properties for this resource.", - "x-ms-client-flatten": true, - "x-ms-mutability": [ - "read", - "create" - ] + "x-ms-client-flatten": true } }, "allOf": [ diff --git a/packages/samples/test/output/azure/resource-manager/resource-types/extension/@azure-tools/typespec-autorest/2021-10-01-preview/openapi.json b/packages/samples/test/output/azure/resource-manager/resource-types/extension/@azure-tools/typespec-autorest/2021-10-01-preview/openapi.json index b1a17b9ae5..b9c7ea9a6d 100644 --- a/packages/samples/test/output/azure/resource-manager/resource-types/extension/@azure-tools/typespec-autorest/2021-10-01-preview/openapi.json +++ b/packages/samples/test/output/azure/resource-manager/resource-types/extension/@azure-tools/typespec-autorest/2021-10-01-preview/openapi.json @@ -402,11 +402,7 @@ "properties": { "$ref": "#/definitions/RoleAssignmentProperties", "description": "The resource-specific properties for this resource.", - "x-ms-client-flatten": true, - "x-ms-mutability": [ - "read", - "create" - ] + "x-ms-client-flatten": true } }, "allOf": [ diff --git a/packages/samples/test/output/azure/resource-manager/resource-types/location/@azure-tools/typespec-autorest/2021-10-01-preview/openapi.json b/packages/samples/test/output/azure/resource-manager/resource-types/location/@azure-tools/typespec-autorest/2021-10-01-preview/openapi.json index 5b1ee9e4c1..08ccc875f8 100644 --- a/packages/samples/test/output/azure/resource-manager/resource-types/location/@azure-tools/typespec-autorest/2021-10-01-preview/openapi.json +++ b/packages/samples/test/output/azure/resource-manager/resource-types/location/@azure-tools/typespec-autorest/2021-10-01-preview/openapi.json @@ -437,11 +437,7 @@ "properties": { "$ref": "#/definitions/EmployeeProperties", "description": "The resource-specific properties for this resource.", - "x-ms-client-flatten": true, - "x-ms-mutability": [ - "read", - "create" - ] + "x-ms-client-flatten": true } }, "allOf": [ diff --git a/packages/samples/test/output/azure/resource-manager/resource-types/proxy/@azure-tools/typespec-autorest/2021-10-01-preview/openapi.json b/packages/samples/test/output/azure/resource-manager/resource-types/proxy/@azure-tools/typespec-autorest/2021-10-01-preview/openapi.json index 3d4924b7bf..05ff8d16da 100644 --- a/packages/samples/test/output/azure/resource-manager/resource-types/proxy/@azure-tools/typespec-autorest/2021-10-01-preview/openapi.json +++ b/packages/samples/test/output/azure/resource-manager/resource-types/proxy/@azure-tools/typespec-autorest/2021-10-01-preview/openapi.json @@ -731,11 +731,7 @@ "properties": { "$ref": "#/definitions/DependentProperties", "description": "The resource-specific properties for this resource.", - "x-ms-client-flatten": true, - "x-ms-mutability": [ - "read", - "create" - ] + "x-ms-client-flatten": true } }, "allOf": [ @@ -821,11 +817,7 @@ "properties": { "$ref": "#/definitions/EmployeeProperties", "description": "The resource-specific properties for this resource.", - "x-ms-client-flatten": true, - "x-ms-mutability": [ - "read", - "create" - ] + "x-ms-client-flatten": true } }, "allOf": [ diff --git a/packages/samples/test/output/azure/resource-manager/resource-types/singleton/@azure-tools/typespec-autorest/2021-10-01-preview/openapi.json b/packages/samples/test/output/azure/resource-manager/resource-types/singleton/@azure-tools/typespec-autorest/2021-10-01-preview/openapi.json index 7615e63f83..c432ec176d 100644 --- a/packages/samples/test/output/azure/resource-manager/resource-types/singleton/@azure-tools/typespec-autorest/2021-10-01-preview/openapi.json +++ b/packages/samples/test/output/azure/resource-manager/resource-types/singleton/@azure-tools/typespec-autorest/2021-10-01-preview/openapi.json @@ -336,11 +336,7 @@ "properties": { "$ref": "#/definitions/EmployeeProperties", "description": "The resource-specific properties for this resource.", - "x-ms-client-flatten": true, - "x-ms-mutability": [ - "read", - "create" - ] + "x-ms-client-flatten": true } }, "allOf": [ diff --git a/packages/samples/test/output/azure/resource-manager/resource-types/tenant/@azure-tools/typespec-autorest/2021-10-01-preview/openapi.json b/packages/samples/test/output/azure/resource-manager/resource-types/tenant/@azure-tools/typespec-autorest/2021-10-01-preview/openapi.json index a882b24dea..0e3dd4ae27 100644 --- a/packages/samples/test/output/azure/resource-manager/resource-types/tenant/@azure-tools/typespec-autorest/2021-10-01-preview/openapi.json +++ b/packages/samples/test/output/azure/resource-manager/resource-types/tenant/@azure-tools/typespec-autorest/2021-10-01-preview/openapi.json @@ -374,11 +374,7 @@ "properties": { "$ref": "#/definitions/EmployeeProperties", "description": "The resource-specific properties for this resource.", - "x-ms-client-flatten": true, - "x-ms-mutability": [ - "read", - "create" - ] + "x-ms-client-flatten": true } }, "allOf": [ diff --git a/packages/samples/test/output/azure/resource-manager/resource-types/tracked/@azure-tools/typespec-autorest/2021-10-01-preview/openapi.json b/packages/samples/test/output/azure/resource-manager/resource-types/tracked/@azure-tools/typespec-autorest/2021-10-01-preview/openapi.json index eae05cf8bc..409703629a 100644 --- a/packages/samples/test/output/azure/resource-manager/resource-types/tracked/@azure-tools/typespec-autorest/2021-10-01-preview/openapi.json +++ b/packages/samples/test/output/azure/resource-manager/resource-types/tracked/@azure-tools/typespec-autorest/2021-10-01-preview/openapi.json @@ -450,11 +450,7 @@ "properties": { "$ref": "#/definitions/EmployeeProperties", "description": "The resource-specific properties for this resource.", - "x-ms-client-flatten": true, - "x-ms-mutability": [ - "read", - "create" - ] + "x-ms-client-flatten": true } }, "allOf": [ diff --git a/packages/samples/test/output/azure/resource-manager/resource-types/virtual-resource/@azure-tools/typespec-autorest/2021-10-01-preview/openapi.json b/packages/samples/test/output/azure/resource-manager/resource-types/virtual-resource/@azure-tools/typespec-autorest/2021-10-01-preview/openapi.json index 2a67c3d2b7..8fead9ff27 100644 --- a/packages/samples/test/output/azure/resource-manager/resource-types/virtual-resource/@azure-tools/typespec-autorest/2021-10-01-preview/openapi.json +++ b/packages/samples/test/output/azure/resource-manager/resource-types/virtual-resource/@azure-tools/typespec-autorest/2021-10-01-preview/openapi.json @@ -542,11 +542,7 @@ "properties": { "$ref": "#/definitions/EmployeeProperties", "description": "The resource-specific properties for this resource.", - "x-ms-client-flatten": true, - "x-ms-mutability": [ - "read", - "create" - ] + "x-ms-client-flatten": true } }, "allOf": [ diff --git a/packages/typespec-azure-resource-manager/lib/foundations/arm.foundations.tsp b/packages/typespec-azure-resource-manager/lib/foundations/arm.foundations.tsp index 644bc0437f..454caec07a 100644 --- a/packages/typespec-azure-resource-manager/lib/foundations/arm.foundations.tsp +++ b/packages/typespec-azure-resource-manager/lib/foundations/arm.foundations.tsp @@ -115,7 +115,11 @@ model ResourceUpdateModelProperties< model ResourceUpdateModel< Resource extends Foundations.Resource, Properties extends TypeSpec.Reflection.Model -> is OptionalProperties>> { +> + is OptionalProperties>> { @extension("x-ms-client-flatten", true) properties?: ResourceUpdateModelProperties; } diff --git a/packages/typespec-azure-resource-manager/lib/models.tsp b/packages/typespec-azure-resource-manager/lib/models.tsp index e5eb45bf68..fb0bfca16e 100644 --- a/packages/typespec-azure-resource-manager/lib/models.tsp +++ b/packages/typespec-azure-resource-manager/lib/models.tsp @@ -46,7 +46,6 @@ model ResourceNameParameter< @includeInapplicableMetadataInPayload(false) model TrackedResource extends Foundations.TrackedResource { @doc("The resource-specific properties for this resource.") - @visibility("read", "create") @extension("x-ms-client-flatten", true) properties?: Properties; } @@ -62,7 +61,6 @@ model TrackedResource extends Foundations.TrackedResource @includeInapplicableMetadataInPayload(false) model ProxyResource extends Foundations.ProxyResource { @doc("The resource-specific properties for this resource.") - @visibility("read", "create") @extension("x-ms-client-flatten", true) properties?: Properties; } @@ -79,7 +77,6 @@ model ProxyResource extends Foundations.ProxyResource { @includeInapplicableMetadataInPayload(false) model ExtensionResource extends Foundations.ExtensionResource { @doc("The resource-specific properties for this resource.") - @visibility("read", "create") @extension("x-ms-client-flatten", true) properties?: Properties; }