diff --git a/common/changes/@autorest/openapi-to-typespec/resourceProperty_2025-09-04-02-47.json b/common/changes/@autorest/openapi-to-typespec/resourceProperty_2025-09-04-02-47.json new file mode 100644 index 0000000000..55b17b784d --- /dev/null +++ b/common/changes/@autorest/openapi-to-typespec/resourceProperty_2025-09-04-02-47.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@autorest/openapi-to-typespec", + "comment": "Fix the missing properties of resource model. Remove useless conditionalFlattern.", + "type": "patch" + } + ], + "packageName": "@autorest/openapi-to-typespec" +} \ No newline at end of file diff --git a/packages/extensions/openapi-to-typespec/src/emiters/emit-typespec-config.ts b/packages/extensions/openapi-to-typespec/src/emiters/emit-typespec-config.ts index 1e7960a45a..a12efced97 100644 --- a/packages/extensions/openapi-to-typespec/src/emiters/emit-typespec-config.ts +++ b/packages/extensions/openapi-to-typespec/src/emiters/emit-typespec-config.ts @@ -43,12 +43,7 @@ options: azure-resource-provider-folder: "resource-manager" output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/${swaggerName}" emit-lro-options: "all" - examples-dir: "{project-root}/examples"${ - isFullCompatible - ? ` - arm-resource-flattening: true` - : "" - } + examples-dir: "{project-root}/examples" linter: extends: - "@azure-tools/typespec-azure-rulesets/resource-manager" diff --git a/packages/extensions/openapi-to-typespec/src/transforms/transform-arm-resources.ts b/packages/extensions/openapi-to-typespec/src/transforms/transform-arm-resources.ts index bcedfa6a28..cede525834 100644 --- a/packages/extensions/openapi-to-typespec/src/transforms/transform-arm-resources.ts +++ b/packages/extensions/openapi-to-typespec/src/transforms/transform-arm-resources.ts @@ -1,4 +1,4 @@ -import { Operation, Parameter, Property, SchemaType } from "@autorest/codemodel"; +import { getAllProperties, Operation, Parameter, Property, SchemaType } from "@autorest/codemodel"; import { capitalize } from "@azure-tools/codegen"; import _ from "lodash"; import { singular } from "pluralize"; @@ -946,7 +946,7 @@ function getOtherProperties( knownProperties.push(...["location", "tags"]); } const otherProperties: (TypespecObjectProperty | TypespecSpreadStatement)[] = []; - for (const property of schema.properties ?? []) { + for (const property of getAllProperties(schema)) { if (!knownProperties.includes(property.serializedName)) { const envolopeProperty = getEnvelopeProperty(property); otherProperties.push( diff --git a/packages/extensions/openapi-to-typespec/src/utils/decorators.ts b/packages/extensions/openapi-to-typespec/src/utils/decorators.ts index 9b33bebbdf..68fb3d726b 100644 --- a/packages/extensions/openapi-to-typespec/src/utils/decorators.ts +++ b/packages/extensions/openapi-to-typespec/src/utils/decorators.ts @@ -172,14 +172,6 @@ export function getPropertyDecorators(element: Property | Parameter): TypespecDe }); } - if (element.extensions?.["x-ms-client-flatten"] && isFullCompatible) { - decorators.push({ - name: "Azure.ResourceManager.Private.conditionalClientFlatten", - suppressionCode: "@azure-tools/typespec-azure-core/no-private-usage", - suppressionMessage: "For backward compatibility", - }); - } - return decorators; } diff --git a/packages/extensions/openapi-to-typespec/test/arm-agrifood/swagger-output/swagger.json b/packages/extensions/openapi-to-typespec/test/arm-agrifood/swagger-output/swagger.json index a974d346c0..cdf28dd37b 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-agrifood/swagger-output/swagger.json +++ b/packages/extensions/openapi-to-typespec/test/arm-agrifood/swagger-output/swagger.json @@ -2085,8 +2085,7 @@ "properties": { "properties": { "$ref": "#/definitions/DataConnectorProperties", - "description": "DataConnector Properties.", - "x-ms-client-flatten": true + "description": "DataConnector Properties." }, "eTag": { "type": "string", @@ -2163,8 +2162,7 @@ "properties": { "properties": { "$ref": "#/definitions/DataManagerForAgricultureExtensionProperties", - "description": "DataManagerForAgricultureExtension properties.", - "x-ms-client-flatten": true + "description": "DataManagerForAgricultureExtension properties." } }, "allOf": [ @@ -2338,8 +2336,7 @@ "properties": { "properties": { "$ref": "#/definitions/DataManagerForAgricultureSolutionProperties", - "description": "DataManagerForAgricultureSolution properties.", - "x-ms-client-flatten": true + "description": "DataManagerForAgricultureSolution properties." } }, "allOf": [ @@ -2804,8 +2801,7 @@ "properties": { "properties": { "$ref": "#/definitions/SolutionProperties", - "description": "Solution resource properties.", - "x-ms-client-flatten": true + "description": "Solution resource properties." }, "eTag": { "type": "string", diff --git a/packages/extensions/openapi-to-typespec/test/arm-agrifood/tsp-output/tspconfig.yaml b/packages/extensions/openapi-to-typespec/test/arm-agrifood/tsp-output/tspconfig.yaml index bd0f4d4b90..2466822178 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-agrifood/tsp-output/tspconfig.yaml +++ b/packages/extensions/openapi-to-typespec/test/arm-agrifood/tsp-output/tspconfig.yaml @@ -8,7 +8,6 @@ options: output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/agfood.json" emit-lro-options: "all" examples-dir: "{project-root}/examples" - arm-resource-flattening: true linter: extends: - "@azure-tools/typespec-azure-rulesets/resource-manager" diff --git a/packages/extensions/openapi-to-typespec/test/arm-alertsmanagement/swagger-output/swagger.json b/packages/extensions/openapi-to-typespec/test/arm-alertsmanagement/swagger-output/swagger.json index 654a4158e0..2aea35ae4d 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-alertsmanagement/swagger-output/swagger.json +++ b/packages/extensions/openapi-to-typespec/test/arm-alertsmanagement/swagger-output/swagger.json @@ -1847,8 +1847,7 @@ "properties": { "properties": { "$ref": "#/definitions/AlertProperties", - "description": "Alert property bag", - "x-ms-client-flatten": true + "description": "Alert property bag" } }, "allOf": [ @@ -1949,8 +1948,7 @@ "properties": { "properties": { "$ref": "#/definitions/AlertProcessingRuleProperties", - "description": "Alert processing rule properties.", - "x-ms-client-flatten": true + "description": "Alert processing rule properties." } }, "allOf": [ diff --git a/packages/extensions/openapi-to-typespec/test/arm-alertsmanagement/tsp-output/models.tsp b/packages/extensions/openapi-to-typespec/test/arm-alertsmanagement/tsp-output/models.tsp index 4da4ab7458..d46ebaf4ac 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-alertsmanagement/tsp-output/models.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-alertsmanagement/tsp-output/models.tsp @@ -536,8 +536,6 @@ model PatchObject { /** * Properties supported by patch operation. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: PatchProperties; /** diff --git a/packages/extensions/openapi-to-typespec/test/arm-alertsmanagement/tsp-output/tspconfig.yaml b/packages/extensions/openapi-to-typespec/test/arm-alertsmanagement/tsp-output/tspconfig.yaml index d30835435e..d581d59ac0 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-alertsmanagement/tsp-output/tspconfig.yaml +++ b/packages/extensions/openapi-to-typespec/test/arm-alertsmanagement/tsp-output/tspconfig.yaml @@ -8,7 +8,6 @@ options: output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/openapi.json" emit-lro-options: "all" examples-dir: "{project-root}/examples" - arm-resource-flattening: true linter: extends: - "@azure-tools/typespec-azure-rulesets/resource-manager" diff --git a/packages/extensions/openapi-to-typespec/test/arm-analysisservices/swagger-output/swagger.json b/packages/extensions/openapi-to-typespec/test/arm-analysisservices/swagger-output/swagger.json index b2635275ca..5bc684568d 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-analysisservices/swagger-output/swagger.json +++ b/packages/extensions/openapi-to-typespec/test/arm-analysisservices/swagger-output/swagger.json @@ -801,8 +801,15 @@ "$ref": "#/definitions/AnalysisServicesServerProperties", "description": "Properties of the provision operation request.", "x-ms-client-flatten": true + }, + "sku": { + "$ref": "#/definitions/ResourceSku", + "description": "The SKU of the Analysis Services resource." } }, + "required": [ + "sku" + ], "allOf": [ { "$ref": "../../common-types/resource-management/v3/types.json#/definitions/TrackedResource" diff --git a/packages/extensions/openapi-to-typespec/test/arm-analysisservices/tsp-output/AnalysisServicesServer.tsp b/packages/extensions/openapi-to-typespec/test/arm-analysisservices/tsp-output/AnalysisServicesServer.tsp index b940c12a62..40e52947bc 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-analysisservices/tsp-output/AnalysisServicesServer.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-analysisservices/tsp-output/AnalysisServicesServer.tsp @@ -21,6 +21,12 @@ model AnalysisServicesServer SegmentName = "servers", NamePattern = "^[a-z][a-z0-9]*$" >; + + /** + * The SKU of the Analysis Services resource. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" + sku: ResourceSku; } @armResourceOperations diff --git a/packages/extensions/openapi-to-typespec/test/arm-analysisservices/tsp-output/models.tsp b/packages/extensions/openapi-to-typespec/test/arm-analysisservices/tsp-output/models.tsp index 9f3b7b802e..19259da538 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-analysisservices/tsp-output/models.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-analysisservices/tsp-output/models.tsp @@ -421,8 +421,6 @@ model AnalysisServicesServerUpdateParameters { /** * Properties of the provision operation request. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: AnalysisServicesServerMutableProperties; } diff --git a/packages/extensions/openapi-to-typespec/test/arm-analysisservices/tsp-output/tspconfig.yaml b/packages/extensions/openapi-to-typespec/test/arm-analysisservices/tsp-output/tspconfig.yaml index b3f7d6a6a5..c33b4ea3ce 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-analysisservices/tsp-output/tspconfig.yaml +++ b/packages/extensions/openapi-to-typespec/test/arm-analysisservices/tsp-output/tspconfig.yaml @@ -8,7 +8,6 @@ options: output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/analysisservices.json" emit-lro-options: "all" examples-dir: "{project-root}/examples" - arm-resource-flattening: true linter: extends: - "@azure-tools/typespec-azure-rulesets/resource-manager" diff --git a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/models.tsp b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/models.tsp index e163e208a6..959e2d71a8 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/models.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/models.tsp @@ -1438,8 +1438,6 @@ model ErrorResponse { /** * Properties of the Error Response. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten error?: ErrorResponseBody; } @@ -1491,8 +1489,6 @@ model ApiCreateOrUpdateParameter { /** * API entity create of update properties. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: ApiCreateOrUpdateProperties; } @@ -1548,8 +1544,6 @@ model ApiUpdateContract { /** * Properties of the API entity that can be updated. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: ApiContractUpdateProperties; } @@ -1911,8 +1905,6 @@ model OperationUpdateContract { /** * Properties of the API Operation entity that can be updated. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: OperationUpdateContractProperties; } @@ -2033,8 +2025,6 @@ model SchemaContractProperties { /** * Create or update Properties of the API Schema Document. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten document?: SchemaDocumentProperties; } @@ -2254,8 +2244,6 @@ model IssueUpdateContract { /** * Issue entity Update contract properties. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: IssueUpdateContractProperties; } @@ -2370,8 +2358,6 @@ model TagDescriptionCreateParameters { /** * Properties supplied to Create TagDescription operation. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: TagDescriptionBaseProperties; } @@ -2615,8 +2601,6 @@ model ApiVersionSetUpdateParameters { /** * Parameters to update or create an API Version Set Contract. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: ApiVersionSetUpdateParametersProperties; } @@ -2758,8 +2742,6 @@ model AuthorizationServerUpdateContract /** * Properties of the External OAuth authorization server update Contract. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: AuthorizationServerUpdateContractProperties; } @@ -3043,8 +3025,6 @@ model BackendUpdateParameters { /** * Backend entity update contract properties. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: BackendUpdateParameterProperties; } @@ -3075,8 +3055,6 @@ model BackendReconnectContract /** * Reconnect request properties. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: BackendReconnectProperties; } @@ -3127,8 +3105,6 @@ model CacheUpdateParameters { /** * Cache update properties details. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: CacheUpdateProperties; } @@ -3244,8 +3220,6 @@ model CertificateCreateOrUpdateParameters { /** * Certificate create or update properties details. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: CertificateCreateOrUpdateProperties; } @@ -4056,8 +4030,6 @@ model RemotePrivateEndpointConnectionWrapper { /** * Resource properties. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: PrivateEndpointConnectionWrapperProperties; } @@ -4182,8 +4154,6 @@ model ApiManagementServiceUpdateParameters extends ApimResource { /** * Properties of the API Management service. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: ApiManagementServiceUpdateProperties; /** @@ -4366,8 +4336,6 @@ model EmailTemplateUpdateParameters { /** * Email Template Update contract properties. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: EmailTemplateUpdateParameterProperties; } @@ -4551,8 +4519,6 @@ model AssociationContract extends Azure.ResourceManager.CommonTypes.Resource { /** * Association entity contract properties. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: AssociationContractProperties; } @@ -4619,8 +4585,6 @@ model GroupCreateParameters { /** * Properties supplied to Create Group operation. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: GroupCreateParametersProperties; } @@ -4658,8 +4622,6 @@ model GroupUpdateParameters { /** * Group entity update contract properties. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: GroupUpdateParametersProperties; } @@ -4853,8 +4815,6 @@ model IdentityProviderCreateContract /** * Identity Provider contract properties. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: IdentityProviderCreateContractProperties; } @@ -4884,8 +4844,6 @@ model IdentityProviderUpdateParameters { /** * Identity Provider update properties. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: IdentityProviderUpdateProperties; } @@ -4958,8 +4916,6 @@ model LoggerUpdateContract { /** * Logger entity update contract properties. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: LoggerUpdateParameters; } @@ -5039,8 +4995,6 @@ model NamedValueCreateContract /** * NamedValue entity contract properties for PUT operation. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: NamedValueCreateContractProperties; } @@ -5077,8 +5031,6 @@ model NamedValueUpdateParameters { /** * NamedValue entity Update contract properties. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: NamedValueUpdateParameterProperties; } @@ -5244,8 +5196,6 @@ model RecipientUserContract extends Azure.ResourceManager.CommonTypes.Resource { /** * Recipient User entity contract properties. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: RecipientUsersContractProperties; } @@ -5268,8 +5218,6 @@ model RecipientEmailContract /** * Recipient Email contract properties. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: RecipientEmailContractProperties; } @@ -5322,8 +5270,6 @@ model OpenidConnectProviderUpdateContract { /** * OpenId Connect Provider Update contract properties. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: OpenidConnectProviderUpdateContractProperties; } @@ -5436,8 +5382,6 @@ model PolicyDescriptionContract /** * Policy description contract properties. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: PolicyDescriptionContractProperties; } @@ -5525,8 +5469,6 @@ model PortalSettingsContract /** * Portal Settings contract properties. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: PortalSettingsContractProperties; } @@ -5700,8 +5642,6 @@ model ProductUpdateParameters { /** * Product entity Update contract properties. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: ProductUpdateProperties; } @@ -5884,8 +5824,6 @@ model QuotaCounterValueUpdateContract { /** * Quota counter value details. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: QuotaCounterValueContractProperties; } @@ -6207,8 +6145,6 @@ model GlobalSchemaContractProperties { /** * Global Schema document object for json-based schema formats(e.g. json schema). */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten document?: unknown; } @@ -6476,8 +6412,6 @@ model SubscriptionCreateParameters { /** * Subscription contract properties. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: SubscriptionCreateParameterProperties; } @@ -6534,8 +6468,6 @@ model SubscriptionUpdateParameters { /** * Subscription Update contract properties. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: SubscriptionUpdateParameterProperties; } @@ -6620,8 +6552,6 @@ model TagCreateUpdateParameters { /** * Properties supplied to Create Tag operation. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: TagContractProperties; } @@ -6653,8 +6583,6 @@ model AccessInformationCreateParameters { /** * Tenant access information update parameter properties. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: AccessInformationCreateParameterProperties; } @@ -6690,8 +6618,6 @@ model AccessInformationUpdateParameters { /** * Tenant access information update parameter properties. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: AccessInformationUpdateParameterProperties; } @@ -6742,8 +6668,6 @@ model DeployConfigurationParameters { /** * Deploy Configuration Parameter contract properties. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: DeployConfigurationParameterProperties; } @@ -6771,8 +6695,6 @@ model OperationResultContract /** * Properties of the Operation Contract. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: OperationResultContractProperties; } @@ -6849,8 +6771,6 @@ model SaveConfigurationParameter { /** * Properties of the Save Configuration Parameters. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: SaveConfigurationParameterProperties; } @@ -6878,8 +6798,6 @@ model TenantConfigurationSyncStateContract /** * Properties returned Tenant Configuration Sync State check. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: TenantConfigurationSyncStateContractProperties; } @@ -6939,8 +6857,6 @@ model UserCreateParameters { /** * User entity create contract properties. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: UserCreateParameterProperties; } @@ -6993,8 +6909,6 @@ model UserUpdateParameters { /** * User entity update contract properties. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: UserUpdateParametersProperties; } @@ -7057,8 +6971,6 @@ model UserTokenParameters { /** * User Token Parameter contract properties. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: UserTokenParameterProperties; } @@ -7123,7 +7035,5 @@ model QuotaCounterValueContract { /** * Quota counter Value Properties. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten value?: QuotaCounterValueContractProperties; } diff --git a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/tspconfig.yaml b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/tspconfig.yaml index d30835435e..d581d59ac0 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/tspconfig.yaml +++ b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/tspconfig.yaml @@ -8,7 +8,6 @@ options: output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/openapi.json" emit-lro-options: "all" examples-dir: "{project-root}/examples" - arm-resource-flattening: true linter: extends: - "@azure-tools/typespec-azure-rulesets/resource-manager" diff --git a/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/models.tsp b/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/models.tsp index df0e6d6505..7f1290372d 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/models.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/models.tsp @@ -288,8 +288,6 @@ model ClassicAdministrator { /** * Properties for the classic administrator. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: ClassicAdministratorProperties; } @@ -463,8 +461,6 @@ model ProviderOperation { /** * The operation properties. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: unknown; /** @@ -551,8 +547,6 @@ model RoleAssignmentCreateParameters { /** * Role assignment properties. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties: RoleAssignmentProperties; } @@ -760,22 +754,16 @@ model ExpandedProperties { /** * Details of the resource scope */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten scope?: ExpandedPropertiesScope; /** * Details of role definition */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten roleDefinition?: ExpandedPropertiesRoleDefinition; /** * Details of the principal */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten principal?: ExpandedPropertiesPrincipal; } @@ -993,8 +981,6 @@ model RoleAssignmentScheduleRequestProperties { /** * Schedule info of the role assignment schedule */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten scheduleInfo?: RoleAssignmentScheduleRequestPropertiesScheduleInfo; /** @@ -1053,8 +1039,6 @@ model RoleAssignmentScheduleRequestPropertiesScheduleInfo { /** * Expiration of the role assignment schedule */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten expiration?: RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration; } @@ -1291,8 +1275,6 @@ model RoleEligibilityScheduleRequestProperties { /** * Schedule info of the role eligibility schedule */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten scheduleInfo?: RoleEligibilityScheduleRequestPropertiesScheduleInfo; /** @@ -1356,8 +1338,6 @@ model RoleEligibilityScheduleRequestPropertiesScheduleInfo { /** * Expiration of the role eligibility schedule */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten expiration?: RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration; } @@ -1516,9 +1496,7 @@ model PolicyProperties { /** * Details of the resource scope */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" @visibility(Lifecycle.Read) - @Azure.ResourceManager.Private.conditionalClientFlatten scope?: PolicyPropertiesScope; } @@ -1582,22 +1560,16 @@ model PolicyAssignmentProperties { /** * Details of the resource scope */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten scope?: PolicyAssignmentPropertiesScope; /** * Details of role definition */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten roleDefinition?: PolicyAssignmentPropertiesRoleDefinition; /** * Details of the policy */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten policy?: PolicyAssignmentPropertiesPolicy; } diff --git a/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/tspconfig.yaml b/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/tspconfig.yaml index d30835435e..d581d59ac0 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/tspconfig.yaml +++ b/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/tspconfig.yaml @@ -8,7 +8,6 @@ options: output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/openapi.json" emit-lro-options: "all" examples-dir: "{project-root}/examples" - arm-resource-flattening: true linter: extends: - "@azure-tools/typespec-azure-rulesets/resource-manager" diff --git a/packages/extensions/openapi-to-typespec/test/arm-azureintegrationspaces/tsp-output/models.tsp b/packages/extensions/openapi-to-typespec/test/arm-azureintegrationspaces/tsp-output/models.tsp index fe778394ff..20d7286a2d 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-azureintegrationspaces/tsp-output/models.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-azureintegrationspaces/tsp-output/models.tsp @@ -137,8 +137,6 @@ model SpaceUpdate { /** * The updatable properties of the Space. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: SpaceUpdateProperties; } @@ -212,8 +210,6 @@ model ApplicationUpdate { /** * The updatable properties of the Application. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: ApplicationUpdateProperties; } @@ -350,8 +346,6 @@ model BusinessProcessUpdate { /** * The updatable properties of the BusinessProcess. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: BusinessProcessUpdateProperties; } @@ -608,8 +602,6 @@ model ApplicationResourceUpdate { /** * The updatable properties of the ApplicationResource. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: ApplicationResourceUpdateProperties; } @@ -676,8 +668,6 @@ model InfrastructureResourceUpdate { /** * The updatable properties of the InfrastructureResource. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: InfrastructureResourceUpdateProperties; } diff --git a/packages/extensions/openapi-to-typespec/test/arm-azureintegrationspaces/tsp-output/tspconfig.yaml b/packages/extensions/openapi-to-typespec/test/arm-azureintegrationspaces/tsp-output/tspconfig.yaml index d30835435e..d581d59ac0 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-azureintegrationspaces/tsp-output/tspconfig.yaml +++ b/packages/extensions/openapi-to-typespec/test/arm-azureintegrationspaces/tsp-output/tspconfig.yaml @@ -8,7 +8,6 @@ options: output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/openapi.json" emit-lro-options: "all" examples-dir: "{project-root}/examples" - arm-resource-flattening: true linter: extends: - "@azure-tools/typespec-azure-rulesets/resource-manager" diff --git a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/CommunityGallery.tsp b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/CommunityGallery.tsp index 0f201e981b..95dd68c7a8 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/CommunityGallery.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/CommunityGallery.tsp @@ -22,6 +22,19 @@ model CommunityGallery is Azure.ResourceManager.ProxyResource<{}> { SegmentName = "communityGalleries", NamePattern = "" >; + + /** + * Resource location + */ + #suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" + @visibility(Lifecycle.Read) + location?: string; + + /** + * The identifier information of community gallery. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" + identifier?: CommunityGalleryIdentifier; } @armResourceOperations diff --git a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/CommunityGalleryImage.tsp b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/CommunityGalleryImage.tsp index 4a14e43d8c..a768d159cf 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/CommunityGalleryImage.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/CommunityGalleryImage.tsp @@ -24,6 +24,19 @@ model CommunityGalleryImage SegmentName = "images", NamePattern = "" >; + + /** + * Resource location + */ + #suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" + @visibility(Lifecycle.Read) + location?: string; + + /** + * The identifier information of community gallery. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" + identifier?: CommunityGalleryIdentifier; } @armResourceOperations diff --git a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/CommunityGalleryImageVersion.tsp b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/CommunityGalleryImageVersion.tsp index e5c5663cac..5d38262a9c 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/CommunityGalleryImageVersion.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/CommunityGalleryImageVersion.tsp @@ -24,6 +24,19 @@ model CommunityGalleryImageVersion SegmentName = "versions", NamePattern = "" >; + + /** + * Resource location + */ + #suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" + @visibility(Lifecycle.Read) + location?: string; + + /** + * The identifier information of community gallery. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" + identifier?: CommunityGalleryIdentifier; } @armResourceOperations diff --git a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/SharedGallery.tsp b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/SharedGallery.tsp index 5b9a12b37e..8ffceaff2e 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/SharedGallery.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/SharedGallery.tsp @@ -22,6 +22,19 @@ model SharedGallery is Azure.ResourceManager.ProxyResource<{}> { SegmentName = "sharedGalleries", NamePattern = "" >; + + /** + * Resource location + */ + #suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" + @visibility(Lifecycle.Read) + location?: string; + + /** + * The identifier information of shared gallery. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" + identifier?: SharedGalleryIdentifier; } @armResourceOperations diff --git a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/SharedGalleryImage.tsp b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/SharedGalleryImage.tsp index 664ac54f5c..aa8a74f73a 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/SharedGalleryImage.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/SharedGalleryImage.tsp @@ -24,6 +24,19 @@ model SharedGalleryImage SegmentName = "images", NamePattern = "" >; + + /** + * Resource location + */ + #suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" + @visibility(Lifecycle.Read) + location?: string; + + /** + * The identifier information of shared gallery. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" + identifier?: SharedGalleryIdentifier; } @armResourceOperations diff --git a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/SharedGalleryImageVersion.tsp b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/SharedGalleryImageVersion.tsp index 14ecd6765c..3694ad28fb 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/SharedGalleryImageVersion.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/SharedGalleryImageVersion.tsp @@ -24,6 +24,19 @@ model SharedGalleryImageVersion SegmentName = "versions", NamePattern = "" >; + + /** + * Resource location + */ + #suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" + @visibility(Lifecycle.Read) + location?: string; + + /** + * The identifier information of shared gallery. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" + identifier?: SharedGalleryIdentifier; } @armResourceOperations diff --git a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/back-compatible.tsp b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/back-compatible.tsp index c9db7ebeec..c4cf59b4e5 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/back-compatible.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/back-compatible.tsp @@ -476,15 +476,29 @@ using Microsoft.Compute; #suppress "deprecated" "@flattenProperty decorator is not recommended to use." @@flattenProperty(GalleryApplicationVersion.properties); +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(SharedGallery.identifier); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(SharedGalleryImage.identifier); #suppress "deprecated" "@flattenProperty decorator is not recommended to use." @@flattenProperty(SharedGalleryImage.properties); +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(SharedGalleryImageVersion.identifier); #suppress "deprecated" "@flattenProperty decorator is not recommended to use." @@flattenProperty(SharedGalleryImageVersion.properties); +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(CommunityGallery.identifier); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(CommunityGalleryImage.identifier); #suppress "deprecated" "@flattenProperty decorator is not recommended to use." @@flattenProperty(CommunityGalleryImage.properties); +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(CommunityGalleryImageVersion.identifier); #suppress "deprecated" "@flattenProperty decorator is not recommended to use." @@flattenProperty(CommunityGalleryImageVersion.properties); diff --git a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/models.tsp b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/models.tsp index d5fb1d65be..e3843183a7 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/models.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/models.tsp @@ -2013,8 +2013,6 @@ model ComputeOperationValue { /** * Describes the properties of a Compute Operation Value Display. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten display?: ComputeOperationValueDisplay; } @@ -3167,8 +3165,6 @@ model VirtualMachineScaleSetNetworkConfiguration { /** * Describes a virtual machine scale set network profile's IP configuration. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: VirtualMachineScaleSetNetworkConfigurationProperties; } @@ -3255,8 +3251,6 @@ model VirtualMachineScaleSetIPConfiguration { /** * Describes a virtual machine scale set network profile's IP configuration properties. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: VirtualMachineScaleSetIPConfigurationProperties; } @@ -3317,8 +3311,6 @@ model VirtualMachineScaleSetPublicIPAddressConfiguration { /** * Describes a virtual machines scale set IP Configuration's PublicIPAddress configuration */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: VirtualMachineScaleSetPublicIPAddressConfigurationProperties; /** @@ -4069,8 +4061,6 @@ model VirtualMachineScaleSetUpdate extends UpdateResource { /** * Describes the properties of a Virtual Machine Scale Set. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: VirtualMachineScaleSetUpdateProperties; /** @@ -4322,8 +4312,6 @@ model VirtualMachineScaleSetUpdateNetworkConfiguration { /** * Describes a virtual machine scale set updatable network profile's IP configuration.Use this object for updating network profile's IP Configuration. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: VirtualMachineScaleSetUpdateNetworkConfigurationProperties; } @@ -4400,8 +4388,6 @@ model VirtualMachineScaleSetUpdateIPConfiguration { /** * Describes a virtual machine scale set network profile's IP configuration properties. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: VirtualMachineScaleSetUpdateIPConfigurationProperties; } @@ -4462,8 +4448,6 @@ model VirtualMachineScaleSetUpdatePublicIPAddressConfiguration { /** * Describes a virtual machines scale set IP Configuration's PublicIPAddress configuration */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties; } @@ -4638,8 +4622,6 @@ model VirtualMachineScaleSetExtensionUpdate extends SubResourceReadOnly { /** * Describes the properties of a Virtual Machine Scale Set Extension. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: VirtualMachineScaleSetExtensionProperties; } @@ -5027,8 +5009,6 @@ model VirtualMachineScaleSetVMExtensionUpdate extends SubResourceReadOnly { /** * Describes the properties of a Virtual Machine Extension. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: VirtualMachineExtensionUpdateProperties; } @@ -5750,8 +5730,6 @@ model NetworkInterfaceReference extends SubResource { /** * Describes a network interface reference properties. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: NetworkInterfaceReferenceProperties; } @@ -5782,8 +5760,6 @@ model VirtualMachineNetworkInterfaceConfiguration { /** * Describes a virtual machine network profile's IP configuration. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: VirtualMachineNetworkInterfaceConfigurationProperties; } @@ -5873,8 +5849,6 @@ model VirtualMachineNetworkInterfaceIPConfiguration { /** * Describes a virtual machine network interface IP configuration properties. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: VirtualMachineNetworkInterfaceIPConfigurationProperties; } @@ -5930,8 +5904,6 @@ model VirtualMachinePublicIPAddressConfiguration { /** * Describes a virtual machines IP Configuration's PublicIPAddress configuration */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: VirtualMachinePublicIPAddressConfigurationProperties; /** @@ -6090,8 +6062,6 @@ model VirtualMachineExtensionUpdate extends UpdateResource { /** * Describes the properties of a Virtual Machine Extension. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: VirtualMachineExtensionUpdateProperties; } @@ -6551,8 +6521,6 @@ model VirtualMachineUpdate extends UpdateResource { /** * Describes the properties of a Virtual Machine. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: VirtualMachineProperties; /** @@ -6897,8 +6865,6 @@ model VirtualMachineImage extends VirtualMachineImageResource { /** * Describes the properties of a Virtual Machine Image. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: VirtualMachineImageProperties; } @@ -7169,8 +7135,6 @@ model AvailabilitySetUpdate extends UpdateResource { /** * The instance view of a resource. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: AvailabilitySetProperties; /** @@ -7364,8 +7328,6 @@ model DedicatedHostGroupUpdate extends UpdateResource { /** * Dedicated Host Group Properties. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: DedicatedHostGroupProperties; /** @@ -7441,8 +7403,6 @@ model DedicatedHostUpdate extends UpdateResource { /** * Properties of the dedicated host. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: DedicatedHostProperties; /** @@ -7482,8 +7442,6 @@ model SshPublicKeyUpdateResource extends UpdateResource { /** * Properties of the SSH public key. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: SshPublicKeyResourceProperties; } @@ -7630,8 +7588,6 @@ model ImageUpdate extends UpdateResource { /** * Describes the properties of an Image. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: ImageProperties; } @@ -8008,8 +7964,6 @@ model RestorePointCollectionUpdate extends UpdateResource { /** * The restore point collection properties. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: RestorePointCollectionProperties; } @@ -8101,8 +8055,6 @@ model CapacityReservationGroupUpdate extends UpdateResource { /** * capacity reservation group Properties. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: CapacityReservationGroupProperties; } @@ -8164,8 +8116,6 @@ model CapacityReservationUpdate extends UpdateResource { /** * Properties of the Capacity reservation. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: CapacityReservationProperties; /** @@ -8559,8 +8509,6 @@ model VirtualMachineRunCommandUpdate extends UpdateResource { /** * Describes the properties of a Virtual Machine run command. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: VirtualMachineRunCommandProperties; } @@ -9027,8 +8975,6 @@ model DiskUpdate { /** * Disk resource update properties. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: DiskUpdateProperties; /** @@ -9306,8 +9252,6 @@ model PrivateLinkResource { /** * Resource properties. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: PrivateLinkResourceProperties; /** @@ -9451,8 +9395,6 @@ model DiskEncryptionSetUpdate { /** * disk encryption set resource update properties. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: DiskEncryptionSetUpdateProperties; /** @@ -9796,8 +9738,6 @@ model SnapshotUpdate { /** * Snapshot resource update properties. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: SnapshotUpdateProperties; /** @@ -10311,8 +10251,6 @@ model GalleryUpdate extends UpdateResourceDefinition { /** * Describes the properties of a Shared Image Gallery. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: GalleryProperties; } @@ -10531,8 +10469,6 @@ model GalleryImageUpdate extends UpdateResourceDefinition { /** * Describes the properties of a gallery image definition. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: GalleryImageProperties; } @@ -10955,8 +10891,6 @@ model GalleryImageVersionUpdate extends UpdateResourceDefinition { /** * Describes the properties of a gallery image version. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: GalleryImageVersionProperties; } @@ -11067,8 +11001,6 @@ model GalleryApplicationUpdate extends UpdateResourceDefinition { /** * Describes the properties of a gallery Application Definition. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: GalleryApplicationProperties; } @@ -11199,8 +11131,6 @@ model GalleryApplicationVersionUpdate extends UpdateResourceDefinition { /** * Describes the properties of a gallery image version. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: GalleryApplicationVersionProperties; } @@ -11259,8 +11189,6 @@ model PirSharedGalleryResource extends PirResource { /** * The identifier information of shared gallery. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten identifier?: SharedGalleryIdentifier; } @@ -11472,8 +11400,6 @@ model PirCommunityGalleryResource { /** * The identifier information of community gallery. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten identifier?: CommunityGalleryIdentifier; } @@ -11929,8 +11855,6 @@ model LoadBalancerConfiguration { /** * Properties of the load balancer configuration. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties: LoadBalancerConfigurationProperties; } @@ -11957,8 +11881,6 @@ model LoadBalancerFrontendIpConfiguration { /** * Properties of load balancer frontend ip configuration. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties: LoadBalancerFrontendIpConfigurationProperties; } @@ -12005,8 +11927,6 @@ model Extension { /** * Extension Properties. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: CloudServiceExtensionProperties; } diff --git a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/tspconfig.yaml b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/tspconfig.yaml index d30835435e..d581d59ac0 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/tspconfig.yaml +++ b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/tspconfig.yaml @@ -8,7 +8,6 @@ options: output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/openapi.json" emit-lro-options: "all" examples-dir: "{project-root}/examples" - arm-resource-flattening: true linter: extends: - "@azure-tools/typespec-azure-rulesets/resource-manager" diff --git a/packages/extensions/openapi-to-typespec/test/arm-guestconfiguration/tsp-output/GuestConfigurationAssignment.tsp b/packages/extensions/openapi-to-typespec/test/arm-guestconfiguration/tsp-output/GuestConfigurationAssignment.tsp index 99854b600f..4a36802762 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-guestconfiguration/tsp-output/GuestConfigurationAssignment.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-guestconfiguration/tsp-output/GuestConfigurationAssignment.tsp @@ -21,6 +21,12 @@ model GuestConfigurationAssignment SegmentName = "guestConfigurationAssignments", NamePattern = "" >; + + /** + * Region where the VM is located. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" + location?: string; } alias GuestConfigurationAssignmentOps = Azure.ResourceManager.Legacy.ExtensionOperations< diff --git a/packages/extensions/openapi-to-typespec/test/arm-guestconfiguration/tsp-output/models.tsp b/packages/extensions/openapi-to-typespec/test/arm-guestconfiguration/tsp-output/models.tsp index 86133c9149..a43511830a 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-guestconfiguration/tsp-output/models.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-guestconfiguration/tsp-output/models.tsp @@ -714,8 +714,6 @@ model Operation { /** * Provider, Resource, Operation and description values. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: OperationProperties; } diff --git a/packages/extensions/openapi-to-typespec/test/arm-guestconfiguration/tsp-output/tspconfig.yaml b/packages/extensions/openapi-to-typespec/test/arm-guestconfiguration/tsp-output/tspconfig.yaml index cf28e30192..4f8bd8bb57 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-guestconfiguration/tsp-output/tspconfig.yaml +++ b/packages/extensions/openapi-to-typespec/test/arm-guestconfiguration/tsp-output/tspconfig.yaml @@ -8,7 +8,6 @@ options: output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/guestconfiguration.json" emit-lro-options: "all" examples-dir: "{project-root}/examples" - arm-resource-flattening: true linter: extends: - "@azure-tools/typespec-azure-rulesets/resource-manager" diff --git a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/models.tsp b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/models.tsp index 515a5e7cab..a48676a208 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/models.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/models.tsp @@ -3739,8 +3739,6 @@ model ClusterUpdateParameters { /** * The properties of the amlCompute. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: ClusterUpdateProperties; } @@ -6607,8 +6605,6 @@ model RegistryPrivateEndpointConnection { /** * Properties of the Private Endpoint Connection */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: RegistryPrivateEndpointConnectionProperties; } @@ -7330,8 +7326,6 @@ model SharedPrivateLinkResource { /** * Properties of a shared private link resource. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: SharedPrivateLinkResourceProperty; } @@ -7382,8 +7376,6 @@ model WorkspaceUpdateParameters { /** * The properties that the machine learning workspace will be updated with. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: WorkspacePropertiesUpdateParameters; /** @@ -7851,8 +7843,6 @@ model PrivateLinkResource extends Azure.ResourceManager.CommonTypes.Resource { /** * Properties of a private link resource. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: PrivateLinkResourceProperties; /** diff --git a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/tspconfig.yaml b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/tspconfig.yaml index d30835435e..d581d59ac0 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/tspconfig.yaml +++ b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/tspconfig.yaml @@ -8,7 +8,6 @@ options: output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/openapi.json" emit-lro-options: "all" examples-dir: "{project-root}/examples" - arm-resource-flattening: true linter: extends: - "@azure-tools/typespec-azure-rulesets/resource-manager" diff --git a/packages/extensions/openapi-to-typespec/test/arm-quota/tsp-output/models.tsp b/packages/extensions/openapi-to-typespec/test/arm-quota/tsp-output/models.tsp index d182044900..52e5595634 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-quota/tsp-output/models.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-quota/tsp-output/models.tsp @@ -273,9 +273,7 @@ model GroupQuotaDetails { /** * Name of the resource provided by the resource provider. This property is already included in the request URI, so it is a readonly property returned in the response. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" @visibility(Lifecycle.Read) - @Azure.ResourceManager.Private.conditionalClientFlatten name?: GroupQuotaDetailsName; /** @@ -364,9 +362,7 @@ model SubmittedResourceRequestStatusProperties { * The new GroupQuota limit requested. */ model GroupQuotaRequestBase { - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" #suppress "@azure-tools/typespec-azure-core/documentation-required" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: GroupQuotaRequestBaseProperties; } @@ -380,9 +376,7 @@ model GroupQuotaRequestBaseProperties { /** * Name of the resource provided by the resource provider. This property is already included in the request URI, so it is a readonly property returned in the response. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" @visibility(Lifecycle.Read) - @Azure.ResourceManager.Private.conditionalClientFlatten name?: GroupQuotaRequestBasePropertiesName; /** @@ -468,9 +462,7 @@ model SubscriptionQuotaDetails { /** * Name of the resource provided by the resource provider. This property is already included in the request URI, so it is a readonly property returned in the response. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" @visibility(Lifecycle.Read) - @Azure.ResourceManager.Private.conditionalClientFlatten name?: SubscriptionQuotaDetailsName; } @@ -522,9 +514,7 @@ model QuotaAllocationRequestStatusProperties { * The new quota request allocated to subscription. */ model QuotaAllocationRequestBase { - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" #suppress "@azure-tools/typespec-azure-core/documentation-required" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: QuotaAllocationRequestBaseProperties; } @@ -538,9 +528,7 @@ model QuotaAllocationRequestBaseProperties { /** * Name of the resource provided by the resource provider. This property is already included in the request URI, so it is a readonly property returned in the response. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" @visibility(Lifecycle.Read) - @Azure.ResourceManager.Private.conditionalClientFlatten name?: QuotaAllocationRequestBasePropertiesName; /** @@ -959,8 +947,6 @@ model GroupQuotaUsagesBase { /** * Name of the resource provided by the resource provider. This property is already included in the request URI, so it is a readonly property returned in the response. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten name?: GroupQuotaUsagesBaseName; /** @@ -1079,8 +1065,6 @@ model QuotaRequestOneResourceSubmitResponse { /** * Quota request details. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: QuotaRequestOneResourceProperties; } @@ -1213,8 +1197,6 @@ model QuotaRequestSubmitResponse202 { /** * Quota request status. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: QuotaRequestStatusDetails; } diff --git a/packages/extensions/openapi-to-typespec/test/arm-quota/tsp-output/tspconfig.yaml b/packages/extensions/openapi-to-typespec/test/arm-quota/tsp-output/tspconfig.yaml index d30835435e..d581d59ac0 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-quota/tsp-output/tspconfig.yaml +++ b/packages/extensions/openapi-to-typespec/test/arm-quota/tsp-output/tspconfig.yaml @@ -8,7 +8,6 @@ options: output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/openapi.json" emit-lro-options: "all" examples-dir: "{project-root}/examples" - arm-resource-flattening: true linter: extends: - "@azure-tools/typespec-azure-rulesets/resource-manager" diff --git a/packages/extensions/openapi-to-typespec/test/arm-servicenetworking/tsp-output/models.tsp b/packages/extensions/openapi-to-typespec/test/arm-servicenetworking/tsp-output/models.tsp index cd19351325..5b8673cb63 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-servicenetworking/tsp-output/models.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-servicenetworking/tsp-output/models.tsp @@ -195,8 +195,6 @@ model AssociationUpdate { /** * The updatable properties of the Association. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: AssociationUpdateProperties; } diff --git a/packages/extensions/openapi-to-typespec/test/arm-servicenetworking/tsp-output/tspconfig.yaml b/packages/extensions/openapi-to-typespec/test/arm-servicenetworking/tsp-output/tspconfig.yaml index b177c6011c..798ab6a303 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-servicenetworking/tsp-output/tspconfig.yaml +++ b/packages/extensions/openapi-to-typespec/test/arm-servicenetworking/tsp-output/tspconfig.yaml @@ -8,7 +8,6 @@ options: output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/TrafficController.json" emit-lro-options: "all" examples-dir: "{project-root}/examples" - arm-resource-flattening: true linter: extends: - "@azure-tools/typespec-azure-rulesets/resource-manager" diff --git a/packages/extensions/openapi-to-typespec/test/arm-storage/swagger-output/swagger.json b/packages/extensions/openapi-to-typespec/test/arm-storage/swagger-output/swagger.json index 2464e171b9..3f7f23d2df 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-storage/swagger-output/swagger.json +++ b/packages/extensions/openapi-to-typespec/test/arm-storage/swagger-output/swagger.json @@ -5912,6 +5912,11 @@ "$ref": "#/definitions/ContainerProperties", "description": "Properties of the blob container.", "x-ms-client-flatten": true + }, + "etag": { + "type": "string", + "description": "\"If etag is provided in the response body, it may also be provided as a header per the normal etag convention. Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields.\")", + "readOnly": true } }, "allOf": [ @@ -7114,6 +7119,11 @@ "$ref": "#/definitions/FileShareProperties", "description": "Properties of the file share.", "x-ms-client-flatten": true + }, + "etag": { + "type": "string", + "description": "\"If etag is provided in the response body, it may also be provided as a header per the normal etag convention. Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields.\")", + "readOnly": true } }, "allOf": [ @@ -7429,6 +7439,11 @@ "$ref": "#/definitions/ImmutabilityPolicyProperty", "description": "The properties of an ImmutabilityPolicy of a blob container.", "x-ms-client-flatten": true + }, + "etag": { + "type": "string", + "description": "\"If etag is provided in the response body, it may also be provided as a header per the normal etag convention. Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields.\")", + "readOnly": true } }, "required": [ diff --git a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/BlobContainer.tsp b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/BlobContainer.tsp index 143efd544f..392df27759 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/BlobContainer.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/BlobContainer.tsp @@ -23,6 +23,7 @@ model BlobContainer SegmentName = "containers", NamePattern = "" >; + ...Azure.ResourceManager.Legacy.EntityTagProperty; } @armResourceOperations diff --git a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/FileShare.tsp b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/FileShare.tsp index d52c6989d0..dd21036eb6 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/FileShare.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/FileShare.tsp @@ -22,6 +22,7 @@ model FileShare is Azure.ResourceManager.ProxyResource { SegmentName = "shares", NamePattern = "" >; + ...Azure.ResourceManager.Legacy.EntityTagProperty; } @armResourceOperations diff --git a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/ImmutabilityPolicy.tsp b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/ImmutabilityPolicy.tsp index 30501e303d..c95a818dc4 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/ImmutabilityPolicy.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/ImmutabilityPolicy.tsp @@ -24,6 +24,7 @@ model ImmutabilityPolicy SegmentName = "immutabilityPolicies", NamePattern = "" >; + ...Azure.ResourceManager.Legacy.EntityTagProperty; } @armResourceOperations diff --git a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/models.tsp b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/models.tsp index c4c77aa3a2..02e126916c 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/models.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/models.tsp @@ -829,8 +829,6 @@ model Operation { /** * Properties of operation, include metric specifications. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: OperationProperties; } @@ -1116,8 +1114,6 @@ model StorageAccountCreateParameters { /** * The parameters used to create the storage account. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: StorageAccountPropertiesCreateParameters; } @@ -2232,8 +2228,6 @@ model StorageAccountUpdateParameters { /** * The parameters used when updating a storage account. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: StorageAccountPropertiesUpdateParameters; /** @@ -3170,8 +3164,6 @@ model PrivateLinkResource extends Azure.ResourceManager.CommonTypes.Resource { /** * Resource properties. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: PrivateLinkResourceProperties; } @@ -3780,8 +3772,6 @@ model ImmutabilityPolicyProperties { /** * The properties of an ImmutabilityPolicy of a blob container. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: ImmutabilityPolicyProperty; /** @@ -4462,8 +4452,6 @@ model ListContainerItem extends AzureEntityResource { /** * The blob container properties be listed out. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: ContainerProperties; } @@ -4475,8 +4463,6 @@ model FileShareItem extends AzureEntityResource { /** * The file share properties be listed out. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: FileShareProperties; } @@ -4486,8 +4472,6 @@ model ListQueue extends Azure.ResourceManager.CommonTypes.Resource { /** * List Queue resource properties. */ - #suppress "@azure-tools/typespec-azure-core/no-private-usage" "For backward compatibility" - @Azure.ResourceManager.Private.conditionalClientFlatten properties?: ListQueueProperties; } diff --git a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/tspconfig.yaml b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/tspconfig.yaml index d30835435e..d581d59ac0 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/tspconfig.yaml +++ b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/tspconfig.yaml @@ -8,7 +8,6 @@ options: output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/openapi.json" emit-lro-options: "all" examples-dir: "{project-root}/examples" - arm-resource-flattening: true linter: extends: - "@azure-tools/typespec-azure-rulesets/resource-manager" diff --git a/packages/extensions/openapi-to-typespec/test/webpubsub/readme.md b/packages/extensions/openapi-to-typespec/test/webpubsub/readme.md index 1a6c939d5d..dd4118d3e3 100644 --- a/packages/extensions/openapi-to-typespec/test/webpubsub/readme.md +++ b/packages/extensions/openapi-to-typespec/test/webpubsub/readme.md @@ -1,6 +1,6 @@ ```yaml require: - - https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/webpubsub/data-plane/readme.md + - https://github.com/Azure/azure-rest-api-specs/blob/c2462b79745a22cccf825973c64fa4c53ce29ceb/specification/webpubsub/data-plane/readme.md clear-output-folder: false isAzureSpec: true guessResourceKey: true