Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ options:
output-file: "{version-status}/{version}/openapi.json"
examples-dir: "{project-root}/examples"
arm-types-dir: "{project-root}/../../../../common-types/resource-management"
arm-resource-flattening: true

"@azure-tools/typespec-python":
emitter-output-dir: "{output-dir}/{service-dir}/azure-mgmt-advisor"
namespace: "azure.mgmt.advisor"
Expand Down
35 changes: 35 additions & 0 deletions specification/apicenter/ApiCenter.Management/back-compatible.tsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// Contains overrides to make the Autorest Swagger2.0 back compatible
using Microsoft.ApiCenter;

@@Azure.ClientGenerator.Core.Legacy.flattenProperty(Api.properties, "autorest");
@@Azure.ClientGenerator.Core.Legacy.flattenProperty(ApiDefinition.properties,
"autorest"
);
@@Azure.ClientGenerator.Core.Legacy.flattenProperty(ApiVersion.properties,
"autorest"
);
@@Azure.ClientGenerator.Core.Legacy.flattenProperty(DeletedService.properties,
"autorest"
);
@@Azure.ClientGenerator.Core.Legacy.flattenProperty(Deployment.properties,
"autorest"
);
@@Azure.ClientGenerator.Core.Legacy.flattenProperty(Environment.properties,
"autorest"
);
@@Azure.ClientGenerator.Core.Legacy.flattenProperty(MetadataSchema.properties,
"autorest"
);
@@Azure.ClientGenerator.Core.Legacy.flattenProperty(Service.properties,
"autorest"
);
// For ServiceUpdate
@@Azure.ClientGenerator.Core.Legacy.flattenProperty(Azure.ResourceManager.Foundations.ResourceUpdateModel.properties,
"autorest"
);
@@Azure.ClientGenerator.Core.Legacy.flattenProperty(Workspace.properties,
"autorest"
);
@@Azure.ClientGenerator.Core.Legacy.flattenProperty(ApiSource.properties,
"autorest"
);
1 change: 1 addition & 0 deletions specification/apicenter/ApiCenter.Management/main.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import "./ApiDefinition.tsp";
import "./ApiSource.tsp";
import "./Deployment.tsp";
import "./Environment.tsp";
import "./back-compatible.tsp";

using TypeSpec.Rest;
using TypeSpec.Http;
Expand Down
2 changes: 0 additions & 2 deletions specification/apicenter/ApiCenter.Management/tspconfig.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ options:
emitter-output-dir: "{project-root}/.."
azure-resource-provider-folder: "resource-manager"
emit-common-types-schema: "never"
# `arm-resource-flattening` is only used for back-compat for specs existed on July 2024. All new service spec should NOT use this flag
arm-resource-flattening: true
output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/apicenter.json"
use-read-only-status-schema: true
linter:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ options:
emitter-output-dir: "{project-root}/.."
azure-resource-provider-folder: "resource-manager"
emit-common-types-schema: "never"
# `arm-resource-flattening` is only used for back-compat for specs existed on July 2024. All new service spec should NOT use this flag
arm-resource-flattening: true
output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/appcomplianceautomation.json"
"@azure-tools/typespec-ts":
experimental-extensible-enums: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ options:
emit-lro-options: "all"
examples-dir: "{project-root}/examples"
arm-types-dir: "{project-root}/../../../../common-types/resource-management"
arm-resource-flattening: true

"@azure-tools/typespec-python":
emitter-output-dir: "{output-dir}/{service-dir}/azure-mgmt-appconfiguration"
namespace: "azure.mgmt.appconfiguration"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import "@azure-tools/typespec-client-generator-core";

using Microsoft.DependencyMap;

// Discriminated type
// @@Azure.ClientGenerator.Core.Legacy.flattenProperty(DiscoverySourceResource.properties,
// "autorest"
// );
@@Azure.ClientGenerator.Core.Legacy.flattenProperty(MapsResource.properties,
"autorest"
);
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ import "@typespec/versioning";
import "@azure-tools/typespec-autorest";
import "@azure-tools/typespec-azure-core";
import "@azure-tools/typespec-azure-resource-manager";

import "./models.tsp";
import "./resources.tsp";
import "./routes.tsp";
//import "@azure-tools/typespec-providerhub";
import "./back-compatible.tsp";

using TypeSpec.Versioning;
using Azure.ResourceManager;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ options:
emitter-output-dir: "{project-root}/.."
azure-resource-provider-folder: "resource-manager"
output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/dependencyMap.json"
arm-resource-flattening: true

version-enum-strategy: true
emit-lro-options: "all"
"@azure-typespec/http-client-csharp-mgmt":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1082,8 +1082,7 @@
"properties": {
"properties": {
"$ref": "#/definitions/DiscoverySourceResourceProperties",
"description": "The resource-specific properties for this resource.",
"x-ms-client-flatten": true
"description": "The resource-specific properties for this resource."
}
},
"allOf": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1082,8 +1082,7 @@
"properties": {
"properties": {
"$ref": "#/definitions/DiscoverySourceResourceProperties",
"description": "The resource-specific properties for this resource.",
"x-ms-client-flatten": true
"description": "The resource-specific properties for this resource."
}
},
"allOf": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1171,8 +1171,7 @@
"properties": {
"properties": {
"$ref": "#/definitions/DiscoverySourceResourceProperties",
"description": "The resource-specific properties for this resource.",
"x-ms-client-flatten": true
"description": "The resource-specific properties for this resource."
}
},
"allOf": [
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import "@azure-tools/typespec-client-generator-core";

using Microsoft.AzureFleet;

@@Azure.ClientGenerator.Core.Legacy.flattenProperty(Fleet.properties,
"autorest"
);
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import "./fleet.tsp";
import "./baseVirtualMachineProfile.tsp";
import "./virtualMachineScaleSet.tsp";
import "./virtualMachine.tsp";
import "./back-compatible.tsp";

using TypeSpec.Http;
using TypeSpec.Rest;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ options:
emitter-output-dir: "{project-root}"
azure-resource-provider-folder: "resource-manager"
emit-common-types-schema: "never"
# `arm-resource-flattening` is only used for back-compat for specs existed on July 2024. All new service spec should NOT use this flag
arm-resource-flattening: true
output-file: "{version-status}/{version}/azurefleet.json"
arm-types-dir: "{project-root}/../../../../common-types/resource-management"
"@azure-tools/typespec-csharp":
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// Contains overrides to make the Autorest Swagger2.0 back compatible

using Microsoft.AzureLargeInstance;

@@Azure.ClientGenerator.Core.Legacy.flattenProperty(AzureLargeInstance.properties,
"autorest"
);

@@Azure.ClientGenerator.Core.Legacy.flattenProperty(AzureLargeStorageInstance.properties,
"autorest"
);
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import "@azure-tools/typespec-azure-resource-manager";
import "./models.tsp";
import "./AzureLargeInstance.tsp";
import "./AzureLargeStorageInstance.tsp";
import "./back-compatible.tsp";

using TypeSpec.Rest;
using TypeSpec.Http;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,5 @@ options:
emitter-output-dir: "{project-root}"
azure-resource-provider-folder: "resource-manager"
arm-types-dir: "{project-root}/../../../../common-types/resource-management"
# `arm-resource-flattening` is only used for back-compat for specs existed on July 2024. All new service spec should NOT use this flag
arm-resource-flattening: true
output-file: "{version-status}/{version}/azurelargeinstance.json"
use-read-only-status-schema: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import "@azure-tools/typespec-client-generator-core";

using Microsoft.AzureStackHCI;

@@Azure.ClientGenerator.Core.Legacy.flattenProperty(AttestationStatus.properties,
"autorest"
);
@@Azure.ClientGenerator.Core.Legacy.flattenProperty(GalleryImage.properties,
"autorest"
);
@@Azure.ClientGenerator.Core.Legacy.flattenProperty(GuestAgent.properties,
"autorest"
);
@@Azure.ClientGenerator.Core.Legacy.flattenProperty(HybridIdentityMetadata.properties,
"autorest"
);
@@Azure.ClientGenerator.Core.Legacy.flattenProperty(LogicalNetwork.properties,
"autorest"
);
@@Azure.ClientGenerator.Core.Legacy.flattenProperty(MarketplaceGalleryImage.properties,
"autorest"
);
@@Azure.ClientGenerator.Core.Legacy.flattenProperty(NetworkInterface.properties,
"autorest"
);
@@Azure.ClientGenerator.Core.Legacy.flattenProperty(NetworkSecurityGroup.properties,
"autorest"
);
@@Azure.ClientGenerator.Core.Legacy.flattenProperty(SecurityRule.properties,
"autorest"
);
@@Azure.ClientGenerator.Core.Legacy.flattenProperty(StorageContainer.properties,
"autorest"
);
@@Azure.ClientGenerator.Core.Legacy.flattenProperty(VirtualHardDisk.properties,
"autorest"
);
@@Azure.ClientGenerator.Core.Legacy.flattenProperty(VirtualMachineInstance.properties,
"autorest"
);
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ import "./VirtualMachineInstance.tsp";
import "./HybridIdentityMetadata.tsp";
import "./AttestationStatus.tsp";
import "./GuestAgent.tsp";
import "./back-compatible.tsp";

using TypeSpec.Rest;
using TypeSpec.Http;
using Azure.Core;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ options:
emitter-output-dir: "{project-root}/.."
azure-resource-provider-folder: "resource-manager"
emit-common-types-schema: "never"
# `arm-resource-flattening` is only used for back-compat for specs existed on July 2024. All new service spec should NOT use this flag
arm-resource-flattening: true
output-file: "{azure-resource-provider-folder}/{service-name}/StackHCIVM/{version-status}/{version}/stackhcivm.json"
"@azure-tools/typespec-python":
service-dir: "sdk/azurestackhci"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ options:
emitter-output-dir: "{project-root}/.."
azure-resource-provider-folder: "resource-manager"
emit-common-types-schema: "never"
# `arm-resource-flattening` is only used for back-compat for specs existed on July 2024. All new service spec should NOT use this flag
arm-resource-flattening: true
output-file: "{azure-resource-provider-folder}/{service-name}/operations/{version-status}/{version}/operations.json"
linter:
extends:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ options:
output-file: "{version-status}/{version}/openapi.json"
examples-dir: "{project-root}/examples"
arm-types-dir: "{project-root}/../../../../common-types/resource-management"
arm-resource-flattening: true

emit-lro-options: "all"
"@azure-tools/typespec-python":
emitter-output-dir: "{output-dir}/{service-dir}/azure-mgmt-cdn"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,29 @@ using Microsoft.Chaos;
@@clientName(Operations.list, "ListAll", "autorest");
@@clientName(ExperimentExecutions.getExecutionDetails, "ExecutionDetails");
@@clientName(PrivateAccesses.privateLinkResources, "GetPrivateLinkResources");

// Flatten properties for backward compatibility
@@Azure.ClientGenerator.Core.Legacy.flattenProperty(Capability.properties,
"autorest"
);
@@Azure.ClientGenerator.Core.Legacy.flattenProperty(CapabilityType.properties,
"autorest"
);
@@Azure.ClientGenerator.Core.Legacy.flattenProperty(ExperimentExecution.properties,
"autorest"
);
@@Azure.ClientGenerator.Core.Legacy.flattenProperty(PrivateAccess.properties,
"autorest"
);
@@Azure.ClientGenerator.Core.Legacy.flattenProperty(PrivateEndpointConnection.properties,
"autorest"
);
@@Azure.ClientGenerator.Core.Legacy.flattenProperty(PrivateLinkResource.properties,
"autorest"
);
@@Azure.ClientGenerator.Core.Legacy.flattenProperty(Target.properties,
"autorest"
);
@@Azure.ClientGenerator.Core.Legacy.flattenProperty(TargetType.properties,
"autorest"
);
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ options:
"@azure-tools/typespec-autorest":
azure-resource-provider-folder: "resource-manager"
emit-common-types-schema: "never"
# `arm-resource-flattening` is only used for back-compat for specs existed on July 2024. All new service spec should NOT use this flag
arm-resource-flattening: true
emitter-output-dir: "{project-root}"
output-file: "{version-status}/{version}/openapi.json"
arm-types-dir: "{project-root}/../../../../common-types/resource-management"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ options:
emitter-output-dir: "{project-root}/.."
azure-resource-provider-folder: "resource-manager"
emit-common-types-schema: "never"
# `arm-resource-flattening` is only used for back-compat for specs existed on July 2024. All new service spec should NOT use this flag
arm-resource-flattening: true
output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/codeSigningAccount.json"
"@azure-tools/typespec-java":
emitter-output-dir: "{output-dir}/{service-dir}/azure-resourcemanager-trustedsigning"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// Contains overrides to make the Autorest Swagger2.0 back compatible
using Microsoft.Community;

@@Azure.ClientGenerator.Core.Legacy.flattenProperty(CommunityTraining.properties,
"autorest"
);
// For CommunityTrainingUpdate
@@Azure.ClientGenerator.Core.Legacy.flattenProperty(Azure.ResourceManager.Foundations.ResourceUpdateModel.properties,
"autorest"
);
3 changes: 3 additions & 0 deletions specification/communitytraining/Community.Management/main.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import "@typespec/rest";
import "@typespec/versioning";
import "@azure-tools/typespec-azure-core";
import "@azure-tools/typespec-azure-resource-manager";
import "@azure-tools/typespec-client-generator-core";

import "./back-compatible.tsp";

using TypeSpec.Http;
using TypeSpec.Rest;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ options:
emitter-output-dir: "{project-root}/.."
azure-resource-provider-folder: "resource-manager"
emit-common-types-schema: "never"
# `arm-resource-flattening` is only used for back-compat for specs existed on July 2024. All new service spec should NOT use this flag
arm-resource-flattening: true
output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/CommunityTrainings.json"
linter:
extends:
Expand Down
2 changes: 1 addition & 1 deletion specification/compute/Compute.Management/tspconfig.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ options:
azure-resource-provider-folder: "resource-manager"
output-file: "{azure-resource-provider-folder}/{service-name}/ComputeRP/{version-status}/{version}/ComputeRP.json"
examples-dir: "{project-root}/examples"
arm-resource-flattening: true

linter:
extends:
- "@azure-tools/typespec-azure-rulesets/resource-manager"
Expand Down
2 changes: 1 addition & 1 deletion specification/compute/Disk.Management/tspconfig.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ options:
azure-resource-provider-folder: "resource-manager"
output-file: "{azure-resource-provider-folder}/{service-name}/DiskRP/{version-status}/{version}/DiskRP.json"
examples-dir: "{project-root}/examples"
arm-resource-flattening: true

linter:
extends:
- "@azure-tools/typespec-azure-rulesets/resource-manager"
Expand Down
2 changes: 1 addition & 1 deletion specification/compute/Sku.Management/tspconfig.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ options:
azure-resource-provider-folder: "resource-manager"
output-file: "{azure-resource-provider-folder}/{service-name}/Skus/{version-status}/{version}/skus.json"
examples-dir: "{project-root}/examples"
arm-resource-flattening: true

linter:
extends:
- "@azure-tools/typespec-azure-rulesets/resource-manager"
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ options:
output-file: "{version-status}/{version}/openapi.json"
emit-lro-options: "all"
examples-dir: "{project-root}/examples"
arm-resource-flattening: true

arm-types-dir: "{project-root}/../../../../common-types/resource-management"
"@azure-tools/typespec-python":
emitter-output-dir: "{output-dir}/{service-dir}/azure-mgmt-consumption"
Expand Down
Loading
Loading