diff --git a/src/AutoRest.CSharp/Common/AutoRest/Plugins/CSharpGen.cs b/src/AutoRest.CSharp/Common/AutoRest/Plugins/CSharpGen.cs index f2758c9214b..5a006ffa697 100644 --- a/src/AutoRest.CSharp/Common/AutoRest/Plugins/CSharpGen.cs +++ b/src/AutoRest.CSharp/Common/AutoRest/Plugins/CSharpGen.cs @@ -97,6 +97,8 @@ public async Task ExecuteAsync(InputNamespace rootNamesp InputNamespaceTransformer.Transform(rootNamespace); MgmtContext.Initialize(new BuildContext(rootNamespace, sourceInputModel)); await MgmtTarget.ExecuteAsync(project); + if (Configuration.GenerateSampleProject) + await MgmtTestTarget.ExecuteAsync(project, rootNamespace, sourceInputModel); } else { diff --git a/src/AutoRest.CSharp/Common/Input/CodeModelConverter.cs b/src/AutoRest.CSharp/Common/Input/CodeModelConverter.cs index e1ccc8fad58..87f430b412c 100644 --- a/src/AutoRest.CSharp/Common/Input/CodeModelConverter.cs +++ b/src/AutoRest.CSharp/Common/Input/CodeModelConverter.cs @@ -155,11 +155,11 @@ private InputOperation CreateOperation(ServiceRequest serviceRequest, Operation generateProtocolMethod: true, generateConvenienceMethod: false, crossLanguageDefinitionId: string.Empty, // in typespec input, this is to determine whether an operation has been renamed. We have separated configuration for that in swagger input, therefore we leave it empty here - keepClientDefaultValue: operationId is null ? false : Configuration.MethodsToKeepClientDefaultValue.Contains(operationId)) + keepClientDefaultValue: operationId is null ? false : Configuration.MethodsToKeepClientDefaultValue.Contains(operationId), + examples: CreateOperationExamplesFromTestModeler(operation)) { SpecName = operation.Language.Default.SerializedName ?? operation.Language.Default.Name }; - inputOperation.CodeModelExamples = CreateOperationExamples(inputOperation, operation); return inputOperation; } @@ -172,8 +172,11 @@ private InputOperation CreateOperation(ServiceRequest serviceRequest, Operation return operationId.Split('_')[0]; } - private IReadOnlyList CreateOperationExamples(InputOperation inputOperation, Operation operation) + private IReadOnlyList? CreateOperationExamplesFromTestModeler(Operation operation) { + if (!Configuration.AzureArm) + return null; + var result = new List(); var exampleOperation = _codeModel.TestModel?.MockTest.ExampleGroups?.FirstOrDefault(g => g.Operation == operation); if (exampleOperation is null) @@ -183,7 +186,7 @@ private IReadOnlyList CreateOperationExamples(InputOperat foreach (var example in exampleOperation.Examples) { var parameters = example.AllParameters - .Select(p => new InputParameterExample(CreateOperationParameter(p.Parameter), CreateExampleValue(p.ExampleValue))) + .Select(p => new InputParameterExample(_parametersCache[p.Parameter](), CreateExampleValue(p.ExampleValue))) .ToList(); result.Add(new InputOperationExample(example.Name, null, example.OriginalFile!, parameters)); } diff --git a/src/AutoRest.CSharp/Common/Input/InputTypes/InputOperation.cs b/src/AutoRest.CSharp/Common/Input/InputTypes/InputOperation.cs index 7ab8dc6f018..6c84e09ad4e 100644 --- a/src/AutoRest.CSharp/Common/Input/InputTypes/InputOperation.cs +++ b/src/AutoRest.CSharp/Common/Input/InputTypes/InputOperation.cs @@ -124,7 +124,7 @@ public static InputOperation RemoveApiVersionParam(InputOperation operation) private IReadOnlyList EnsureExamples() { // see if we need to generate the mock examples - if (Configuration.ExamplesDirectory != null) + if (Configuration.ExamplesDirectory != null || Configuration.AzureArm) { return Array.Empty(); } @@ -133,8 +133,6 @@ private IReadOnlyList EnsureExamples() return ExampleMockValueBuilder.BuildOperationExamples(this); } - public IReadOnlyList CodeModelExamples { get; internal set; } = Array.Empty(); - public bool IsLongRunning => LongRunning != null; public string Name { get; internal set; } public string? ResourceName { get; } diff --git a/src/AutoRest.CSharp/MgmtTest/AutoRest/MgmtTestOutputLibrary.cs b/src/AutoRest.CSharp/MgmtTest/AutoRest/MgmtTestOutputLibrary.cs index a0994dec802..f7d6cf52cc2 100644 --- a/src/AutoRest.CSharp/MgmtTest/AutoRest/MgmtTestOutputLibrary.cs +++ b/src/AutoRest.CSharp/MgmtTest/AutoRest/MgmtTestOutputLibrary.cs @@ -5,7 +5,6 @@ using System.Collections.Generic; using System.Linq; using AutoRest.CSharp.Common.Input; -using AutoRest.CSharp.Input; using AutoRest.CSharp.Mgmt.AutoRest; using AutoRest.CSharp.Mgmt.Output; using AutoRest.CSharp.MgmtTest.Models; @@ -18,11 +17,12 @@ namespace AutoRest.CSharp.MgmtTest.AutoRest internal class MgmtTestOutputLibrary { private readonly InputNamespace _inputNamespace; - private readonly MgmtTestConfiguration _mgmtTestConfiguration; + private readonly HashSet _skippedOperations; + public MgmtTestOutputLibrary(InputNamespace inputNamespace) { _inputNamespace = inputNamespace; - _mgmtTestConfiguration = Configuration.MgmtTestConfiguration!; + _skippedOperations = new HashSet(Configuration.MgmtTestConfiguration?.SkippedOperations ?? []); } private IEnumerable? _samples; @@ -46,13 +46,13 @@ private Dictionary> EnsureMockTestCases() { foreach (var inputOperation in client.Operations) { - foreach (var example in inputOperation.CodeModelExamples) + foreach (var example in inputOperation.Examples) { // we need to find which resource or resource collection this test case belongs var operationId = inputOperation.OperationId!; // skip this operation if we find it in the `skipped-operations` configuration - if (_mgmtTestConfiguration.SkippedOperations.Contains(operationId)) + if (_skippedOperations.Contains(operationId)) continue; var providerAndOperations = FindCarriersFromOperationId(operationId); diff --git a/src/AutoRest.CSharp/MgmtTest/AutoRest/MgmtTestTarget.cs b/src/AutoRest.CSharp/MgmtTest/AutoRest/MgmtTestTarget.cs index 1685e4c1981..689ae0bcd22 100644 --- a/src/AutoRest.CSharp/MgmtTest/AutoRest/MgmtTestTarget.cs +++ b/src/AutoRest.CSharp/MgmtTest/AutoRest/MgmtTestTarget.cs @@ -7,7 +7,6 @@ using System.IO; using System.Threading.Tasks; using AutoRest.CSharp.Common.Input; -using AutoRest.CSharp.Input; using AutoRest.CSharp.Input.Source; using AutoRest.CSharp.Mgmt.AutoRest; using AutoRest.CSharp.MgmtTest.AutoRest; @@ -27,7 +26,6 @@ internal class MgmtTestTarget public static async Task ExecuteAsync(GeneratedCodeWorkspace project, InputNamespace inputNamespace, SourceInputModel? sourceInputModel) { Debug.Assert(inputNamespace.Clients is not null); - Debug.Assert(Configuration.MgmtTestConfiguration is not null); MgmtTestOutputLibrary library; if (sourceInputModel == null) { @@ -43,12 +41,12 @@ public static async Task ExecuteAsync(GeneratedCodeWorkspace project, InputNames library = new MgmtTestOutputLibrary(inputNamespace); } - if (Configuration.MgmtTestConfiguration.Mock) + if (Configuration.MgmtTestConfiguration?.Mock ?? false) { WriteMockTests(project, library); } - if (Configuration.MgmtTestConfiguration.Sample) + if (Configuration.MgmtTestConfiguration?.Sample ?? Configuration.GenerateSampleProject) { WriteSamples(project, library); } @@ -56,7 +54,7 @@ public static async Task ExecuteAsync(GeneratedCodeWorkspace project, InputNames if (_overriddenProjectFilenames.TryGetValue(project, out var overriddenFilenames)) throw new InvalidOperationException($"At least one file was overridden during the generation process. Filenames are: {string.Join(", ", overriddenFilenames)}"); - if (Configuration.MgmtTestConfiguration.ClearOutputFolder) + if (Configuration.MgmtTestConfiguration?.ClearOutputFolder ?? false) { ClearOutputFolder(); } @@ -172,7 +170,7 @@ private static string GetOutputFolder(string defaultOutputPath) // Azure.ResourceManager.XXX \ src \ Generated <- default sdk source output folder // \ samples(or tests) \ Generated <- default sample output folder defined in msbuild if (folder.EndsWith(SOURCE_DEFAULT_OUTPUT_PATH, StringComparison.InvariantCultureIgnoreCase)) - return FormatPath(Path.Combine(folder, $"../..", defaultOutputPath)); + return FormatPath(Path.Combine(folder, $"../../{defaultOutputPath}")); else if (folder.EndsWith(SAMPLE_DEFAULT_OUTPUT_PATH, StringComparison.InvariantCultureIgnoreCase) || folder.EndsWith(MOCK_TEST_DEFAULT_OUTPUT_PATH, StringComparison.InvariantCultureIgnoreCase)) return folder; else diff --git a/test/TestProjects/MgmtTypeSpec/Configuration.json b/test/TestProjects/MgmtTypeSpec/Configuration.json index 4a4ec9f2ca6..a1b6c95c139 100644 --- a/test/TestProjects/MgmtTypeSpec/Configuration.json +++ b/test/TestProjects/MgmtTypeSpec/Configuration.json @@ -8,5 +8,6 @@ "../../../../../artifacts/bin/AutoRest.CSharp/Debug/net8.0/Generator.Shared", "../../../../../artifacts/bin/AutoRest.CSharp/Debug/net8.0/Azure.Core.Shared" ], + "examples-dir": "examples", "azure-arm": true } diff --git a/test/TestProjects/MgmtTypeSpec/examples/2024-05-01/Foos_CreateOrUpdate.json b/test/TestProjects/MgmtTypeSpec/examples/2024-05-01/Foos_CreateOrUpdate.json new file mode 100644 index 00000000000..ceed072a2f6 --- /dev/null +++ b/test/TestProjects/MgmtTypeSpec/examples/2024-05-01/Foos_CreateOrUpdate.json @@ -0,0 +1,29 @@ +{ + "operationId": "Foos_CreateOrUpdate", + "title": "Create a foo", + "parameters": { + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "resourceGroupName": "myRg", + "fooName": "myFoo", + "resource": { + "properties": { + "serviceUrl": "https://myService.com", + "something": "for test only" + } + } + }, + "responses": { + "200": { + "body": { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRg/providers/MgmtTypeSpec/foos/myFoo", + "name": "myFoo", + "type": "MgmtTypeSpec/foos", + "properties": { + "serviceUrl": "https://myService.com", + "something": "for test only" + } + } + } + } + } + \ No newline at end of file diff --git a/test/TestProjects/MgmtTypeSpec/examples/2024-05-01/Foos_Delete.json b/test/TestProjects/MgmtTypeSpec/examples/2024-05-01/Foos_Delete.json new file mode 100644 index 00000000000..000e26827cf --- /dev/null +++ b/test/TestProjects/MgmtTypeSpec/examples/2024-05-01/Foos_Delete.json @@ -0,0 +1,13 @@ +{ + "operationId": "Foos_Get", + "title": "Get a foo", + "parameters": { + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "resourceGroupName": "myRg", + "fooName": "myFoo" + }, + "responses": { + "204": {} + } + } + \ No newline at end of file diff --git a/test/TestProjects/MgmtTypeSpec/examples/2024-05-01/Foos_Get.json b/test/TestProjects/MgmtTypeSpec/examples/2024-05-01/Foos_Get.json new file mode 100644 index 00000000000..bb0f0e8c820 --- /dev/null +++ b/test/TestProjects/MgmtTypeSpec/examples/2024-05-01/Foos_Get.json @@ -0,0 +1,23 @@ +{ + "operationId": "Foos_Get", + "title": "Get a foo", + "parameters": { + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "resourceGroupName": "myRg", + "fooName": "myFoo" + }, + "responses": { + "200": { + "body": { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRg/providers/MgmtTypeSpec/foos/myFoo", + "name": "myFoo", + "type": "MgmtTypeSpec/foos", + "properties": { + "serviceUrl": "https://myService.com", + "something": "for test only" + } + } + } + } + } + \ No newline at end of file diff --git a/test/TestProjects/MgmtTypeSpec/main.tsp b/test/TestProjects/MgmtTypeSpec/main.tsp index 8d3aacb6625..dfa3368c144 100644 --- a/test/TestProjects/MgmtTypeSpec/main.tsp +++ b/test/TestProjects/MgmtTypeSpec/main.tsp @@ -19,5 +19,5 @@ enum Versions { /** Azure Cosmos DB for Mongo vCore clusters api version 2024-03-01-preview. */ @useDependency(Azure.ResourceManager.Versions.v1_0_Preview_1) @useDependency(Azure.Core.Versions.v1_0_Preview_1) - v1, + v2024_05_01: "2024-05-01", } diff --git a/test/TestProjects/MgmtTypeSpec/samples/Generated/Samples/Sample_FooCollection.cs b/test/TestProjects/MgmtTypeSpec/samples/Generated/Samples/Sample_FooCollection.cs new file mode 100644 index 00000000000..50aba18a80d --- /dev/null +++ b/test/TestProjects/MgmtTypeSpec/samples/Generated/Samples/Sample_FooCollection.cs @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager; +using Azure.ResourceManager.Resources; +using MgmtTypeSpec.Models; + +namespace MgmtTypeSpec.Samples +{ + public partial class Sample_FooCollection + { + // Create a foo + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_CreateAFoo() + { + // Generated from example definition: 2024-05-01/Foos_CreateOrUpdate.json + // this example is just showing the usage of "Foos_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myRg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this FooResource + FooCollection collection = resourceGroupResource.GetFoos(); + + // invoke the operation + string fooName = "myFoo"; + FooData data = new FooData(new AzureLocation("placeholder")) + { + Properties = new FooProperties() + { + ServiceUri = new Uri("https://myService.com"), + Something = "for test only", + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, fooName, data); + FooResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FooData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Get a foo + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetAFoo() + { + // Generated from example definition: 2024-05-01/Foos_Get.json + // this example is just showing the usage of "Foos_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myRg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this FooResource + FooCollection collection = resourceGroupResource.GetFoos(); + + // invoke the operation + string fooName = "myFoo"; + FooResource result = await collection.GetAsync(fooName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FooData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Get a foo + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_GetAFoo() + { + // Generated from example definition: 2024-05-01/Foos_Get.json + // this example is just showing the usage of "Foos_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myRg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this FooResource + FooCollection collection = resourceGroupResource.GetFoos(); + + // invoke the operation + string fooName = "myFoo"; + bool result = await collection.ExistsAsync(fooName); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Get a foo + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetIfExists_GetAFoo() + { + // Generated from example definition: 2024-05-01/Foos_Get.json + // this example is just showing the usage of "Foos_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myRg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this FooResource + FooCollection collection = resourceGroupResource.GetFoos(); + + // invoke the operation + string fooName = "myFoo"; + NullableResponse response = await collection.GetIfExistsAsync(fooName); + FooResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine($"Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FooData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/test/TestProjects/MgmtTypeSpec/samples/Generated/Samples/Sample_FooResource.cs b/test/TestProjects/MgmtTypeSpec/samples/Generated/Samples/Sample_FooResource.cs new file mode 100644 index 00000000000..e7c32f6d218 --- /dev/null +++ b/test/TestProjects/MgmtTypeSpec/samples/Generated/Samples/Sample_FooResource.cs @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager; +using MgmtTypeSpec.Models; + +namespace MgmtTypeSpec.Samples +{ + public partial class Sample_FooResource + { + // Create a foo + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Update_CreateAFoo() + { + // Generated from example definition: 2024-05-01/Foos_CreateOrUpdate.json + // this example is just showing the usage of "Foos_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FooResource created on azure + // for more information of creating FooResource, please refer to the document of FooResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myRg"; + string fooName = "myFoo"; + ResourceIdentifier fooResourceId = FooResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fooName); + FooResource foo = client.GetFooResource(fooResourceId); + + // invoke the operation + FooData data = new FooData(new AzureLocation("placeholder")) + { + Properties = new FooProperties() + { + ServiceUri = new Uri("https://myService.com"), + Something = "for test only", + }, + }; + ArmOperation lro = await foo.UpdateAsync(WaitUntil.Completed, data); + FooResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FooData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Get a foo + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetAFoo() + { + // Generated from example definition: 2024-05-01/Foos_Get.json + // this example is just showing the usage of "Foos_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FooResource created on azure + // for more information of creating FooResource, please refer to the document of FooResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myRg"; + string fooName = "myFoo"; + ResourceIdentifier fooResourceId = FooResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fooName); + FooResource foo = client.GetFooResource(fooResourceId); + + // invoke the operation + FooResource result = await foo.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FooData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/test/TestProjects/MgmtTypeSpec/src/Generated/Extensions/MgmtTypeSpecExtensions.cs b/test/TestProjects/MgmtTypeSpec/src/Generated/Extensions/MgmtTypeSpecExtensions.cs index 37a2356c5bb..c9434ee12dc 100644 --- a/test/TestProjects/MgmtTypeSpec/src/Generated/Extensions/MgmtTypeSpecExtensions.cs +++ b/test/TestProjects/MgmtTypeSpec/src/Generated/Extensions/MgmtTypeSpecExtensions.cs @@ -79,7 +79,7 @@ public static FooCollection GetFoos(this ResourceGroupResource resourceGroupReso /// /// /// Default Api Version - /// v1 + /// 2024-05-01 /// /// /// Resource @@ -117,7 +117,7 @@ public static async Task> GetFooAsync(this ResourceGroupRe /// /// /// Default Api Version - /// v1 + /// 2024-05-01 /// /// /// Resource @@ -155,7 +155,7 @@ public static Response GetFoo(this ResourceGroupResource resourceGr /// /// /// Default Api Version - /// v1 + /// 2024-05-01 /// /// /// @@ -187,7 +187,7 @@ public static AsyncPageable GetAllPrivateLi /// /// /// Default Api Version - /// v1 + /// 2024-05-01 /// /// /// diff --git a/test/TestProjects/MgmtTypeSpec/src/Generated/Extensions/MockableMgmtTypeSpecResourceGroupResource.cs b/test/TestProjects/MgmtTypeSpec/src/Generated/Extensions/MockableMgmtTypeSpecResourceGroupResource.cs index 8caf0939f21..ed8c55036f0 100644 --- a/test/TestProjects/MgmtTypeSpec/src/Generated/Extensions/MockableMgmtTypeSpecResourceGroupResource.cs +++ b/test/TestProjects/MgmtTypeSpec/src/Generated/Extensions/MockableMgmtTypeSpecResourceGroupResource.cs @@ -64,7 +64,7 @@ public virtual FooCollection GetFoos() /// /// /// Default Api Version - /// v1 + /// 2024-05-01 /// /// /// Resource @@ -95,7 +95,7 @@ public virtual async Task> GetFooAsync(string fooName, Can /// /// /// Default Api Version - /// v1 + /// 2024-05-01 /// /// /// Resource @@ -126,7 +126,7 @@ public virtual Response GetFoo(string fooName, CancellationToken ca /// /// /// Default Api Version - /// v1 + /// 2024-05-01 /// /// /// @@ -152,7 +152,7 @@ public virtual AsyncPageable GetAllPrivateL /// /// /// Default Api Version - /// v1 + /// 2024-05-01 /// /// /// diff --git a/test/TestProjects/MgmtTypeSpec/src/Generated/FooCollection.cs b/test/TestProjects/MgmtTypeSpec/src/Generated/FooCollection.cs index 2007e567ab7..ad6b3c9819b 100644 --- a/test/TestProjects/MgmtTypeSpec/src/Generated/FooCollection.cs +++ b/test/TestProjects/MgmtTypeSpec/src/Generated/FooCollection.cs @@ -67,7 +67,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// v1 + /// 2024-05-01 /// /// /// Resource @@ -116,7 +116,7 @@ public virtual async Task> CreateOrUpdateAsync(WaitUnt /// /// /// Default Api Version - /// v1 + /// 2024-05-01 /// /// /// Resource @@ -165,7 +165,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, str /// /// /// Default Api Version - /// v1 + /// 2024-05-01 /// /// /// Resource @@ -210,7 +210,7 @@ public virtual async Task> GetAsync(string fooName, Cancel /// /// /// Default Api Version - /// v1 + /// 2024-05-01 /// /// /// Resource @@ -255,7 +255,7 @@ public virtual Response Get(string fooName, CancellationToken cance /// /// /// Default Api Version - /// v1 + /// 2024-05-01 /// /// /// Resource @@ -285,7 +285,7 @@ public virtual AsyncPageable GetAllAsync(CancellationToken cancella /// /// /// Default Api Version - /// v1 + /// 2024-05-01 /// /// /// Resource @@ -315,7 +315,7 @@ public virtual Pageable GetAll(CancellationToken cancellationToken /// /// /// Default Api Version - /// v1 + /// 2024-05-01 /// /// /// Resource @@ -358,7 +358,7 @@ public virtual async Task> ExistsAsync(string fooName, Cancellati /// /// /// Default Api Version - /// v1 + /// 2024-05-01 /// /// /// Resource @@ -401,7 +401,7 @@ public virtual Response Exists(string fooName, CancellationToken cancellat /// /// /// Default Api Version - /// v1 + /// 2024-05-01 /// /// /// Resource @@ -446,7 +446,7 @@ public virtual async Task> GetIfExistsAsync(string /// /// /// Default Api Version - /// v1 + /// 2024-05-01 /// /// /// Resource diff --git a/test/TestProjects/MgmtTypeSpec/src/Generated/FooResource.cs b/test/TestProjects/MgmtTypeSpec/src/Generated/FooResource.cs index 02d7fbfc772..b3f1860eee5 100644 --- a/test/TestProjects/MgmtTypeSpec/src/Generated/FooResource.cs +++ b/test/TestProjects/MgmtTypeSpec/src/Generated/FooResource.cs @@ -104,7 +104,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// v1 + /// 2024-05-01 /// /// /// Resource @@ -144,7 +144,7 @@ public virtual async Task> GetAsync(CancellationToken canc /// /// /// Default Api Version - /// v1 + /// 2024-05-01 /// /// /// Resource @@ -184,7 +184,7 @@ public virtual Response Get(CancellationToken cancellationToken = d /// /// /// Default Api Version - /// v1 + /// 2024-05-01 /// /// /// Resource @@ -226,7 +226,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// v1 + /// 2024-05-01 /// /// /// Resource @@ -268,7 +268,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// v1 + /// 2024-05-01 /// /// /// Resource @@ -314,7 +314,7 @@ public virtual async Task> UpdateAsync(WaitUntil waitU /// /// /// Default Api Version - /// v1 + /// 2024-05-01 /// /// /// Resource @@ -360,7 +360,7 @@ public virtual ArmOperation Update(WaitUntil waitUntil, FooData dat /// /// /// Default Api Version - /// v1 + /// 2024-05-01 /// /// /// Resource @@ -417,7 +417,7 @@ public virtual async Task> AddTagAsync(string key, string /// /// /// Default Api Version - /// v1 + /// 2024-05-01 /// /// /// Resource @@ -474,7 +474,7 @@ public virtual Response AddTag(string key, string value, Cancellati /// /// /// Default Api Version - /// v1 + /// 2024-05-01 /// /// /// Resource @@ -530,7 +530,7 @@ public virtual async Task> SetTagsAsync(IDictionary /// /// Default Api Version - /// v1 + /// 2024-05-01 /// /// /// Resource @@ -586,7 +586,7 @@ public virtual Response SetTags(IDictionary tags, C /// /// /// Default Api Version - /// v1 + /// 2024-05-01 /// /// /// Resource @@ -641,7 +641,7 @@ public virtual async Task> RemoveTagAsync(string key, Canc /// /// /// Default Api Version - /// v1 + /// 2024-05-01 /// /// /// Resource diff --git a/test/TestProjects/MgmtTypeSpec/src/Generated/RestOperations/FoosRestOperations.cs b/test/TestProjects/MgmtTypeSpec/src/Generated/RestOperations/FoosRestOperations.cs index 055a7b465ad..530566b822e 100644 --- a/test/TestProjects/MgmtTypeSpec/src/Generated/RestOperations/FoosRestOperations.cs +++ b/test/TestProjects/MgmtTypeSpec/src/Generated/RestOperations/FoosRestOperations.cs @@ -33,7 +33,7 @@ public FoosRestOperations(HttpPipeline pipeline, string applicationId, Uri endpo { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "v1"; + _apiVersion = apiVersion ?? "2024-05-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/test/TestProjects/MgmtTypeSpec/src/Generated/RestOperations/PrivateLinksRestOperations.cs b/test/TestProjects/MgmtTypeSpec/src/Generated/RestOperations/PrivateLinksRestOperations.cs index 434cae5c50c..854fa8ddb35 100644 --- a/test/TestProjects/MgmtTypeSpec/src/Generated/RestOperations/PrivateLinksRestOperations.cs +++ b/test/TestProjects/MgmtTypeSpec/src/Generated/RestOperations/PrivateLinksRestOperations.cs @@ -33,7 +33,7 @@ public PrivateLinksRestOperations(HttpPipeline pipeline, string applicationId, U { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "v1"; + _apiVersion = apiVersion ?? "2024-05-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/test/TestProjects/MgmtTypeSpec/tspCodeModel.json b/test/TestProjects/MgmtTypeSpec/tspCodeModel.json index 13c9ee38ff5..e495e4e053f 100644 --- a/test/TestProjects/MgmtTypeSpec/tspCodeModel.json +++ b/test/TestProjects/MgmtTypeSpec/tspCodeModel.json @@ -2,7 +2,7 @@ "$id": "1", "Name": "MgmtTypeSpec", "ApiVersions": [ - "v1" + "2024-05-01" ], "Enums": [ { @@ -147,8 +147,8 @@ "Values": [ { "$id": "20", - "Name": "v1", - "Value": "v1", + "Name": "v2024_05_01", + "Value": "2024-05-01", "Description": "Azure Cosmos DB for Mongo vCore clusters api version 2024-03-01-preview.", "Decorators": [] } @@ -1202,7 +1202,7 @@ "Name": "string", "CrossLanguageDefinitionId": "TypeSpec.string" }, - "Value": "v1" + "Value": "2024-05-01" }, "Decorators": [] }, @@ -1394,7 +1394,7 @@ "Name": "string", "CrossLanguageDefinitionId": "TypeSpec.string" }, - "Value": "v1" + "Value": "2024-05-01" }, "Decorators": [] }, @@ -1623,10 +1623,144 @@ "GenerateProtocolMethod": true, "GenerateConvenienceMethod": true, "CrossLanguageDefinitionId": "MgmtTypeSpec.Foos.createOrUpdate", - "Decorators": [] + "Decorators": [], + "Examples": [ + { + "$id": "185", + "kind": "http", + "name": "Create a foo", + "description": "Create a foo", + "filePath": "2024-05-01/Foos_CreateOrUpdate.json", + "rawExample": { + "$id": "186", + "operationId": "Foos_CreateOrUpdate", + "title": "Create a foo", + "parameters": { + "$id": "187", + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "resourceGroupName": "myRg", + "fooName": "myFoo", + "resource": { + "$id": "188", + "properties": { + "$id": "189", + "serviceUrl": "https://myService.com", + "something": "for test only" + } + } + }, + "responses": { + "200": { + "$id": "191", + "body": { + "$id": "192", + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRg/providers/MgmtTypeSpec/foos/myFoo", + "name": "myFoo", + "type": "MgmtTypeSpec/foos", + "properties": { + "$id": "193", + "serviceUrl": "https://myService.com", + "something": "for test only" + } + } + }, + "$id": "190" + } + }, + "parameters": [ + { + "$id": "194", + "parameter": { + "$ref": "163" + }, + "value": { + "$id": "195", + "kind": "string", + "type": { + "$ref": "164" + }, + "value": "00000000-0000-0000-0000-000000000000" + } + }, + { + "$id": "196", + "parameter": { + "$ref": "166" + }, + "value": { + "$id": "197", + "kind": "string", + "type": { + "$ref": "167" + }, + "value": "myRg" + } + }, + { + "$id": "198", + "parameter": { + "$ref": "168" + }, + "value": { + "$id": "199", + "kind": "string", + "type": { + "$ref": "169" + }, + "value": "myFoo" + } + }, + { + "$id": "200", + "parameter": { + "$ref": "176" + }, + "value": { + "$id": "201", + "kind": "model", + "type": { + "$ref": "21" + }, + "value": { + "$id": "202", + "properties": { + "$id": "203", + "kind": "model", + "type": { + "$ref": "52" + }, + "value": { + "$id": "204", + "serviceUrl": { + "$id": "205", + "kind": "string", + "type": { + "$ref": "56" + }, + "value": "https://myService.com" + }, + "something": { + "$id": "206", + "kind": "string", + "type": { + "$ref": "58" + }, + "value": "for test only" + } + } + } + } + } + } + ], + "responses": { + "$id": "207" + } + } + ] }, { - "$id": "185", + "$id": "208", "Name": "get", "ResourceName": "Foos", "Description": "Get a Foo", @@ -1636,12 +1770,12 @@ "$ref": "155" }, { - "$id": "186", + "$id": "209", "Name": "apiVersion", "NameInRequest": "api-version", "Description": "The API version to use for this operation.", "Type": { - "$id": "187", + "$id": "210", "Kind": "string", "Name": "string", "CrossLanguageDefinitionId": "TypeSpec.string", @@ -1655,29 +1789,29 @@ "IsRequired": true, "Kind": "Client", "DefaultValue": { - "$id": "188", + "$id": "211", "Type": { - "$id": "189", + "$id": "212", "Kind": "string", "Name": "string", "CrossLanguageDefinitionId": "TypeSpec.string" }, - "Value": "v1" + "Value": "2024-05-01" }, "Decorators": [] }, { - "$id": "190", + "$id": "213", "Name": "subscriptionId", "NameInRequest": "subscriptionId", "Description": "The ID of the target subscription. The value must be an UUID.", "Type": { - "$id": "191", + "$id": "214", "Kind": "string", "Name": "uuid", "CrossLanguageDefinitionId": "Azure.Core.uuid", "BaseType": { - "$id": "192", + "$id": "215", "Kind": "string", "Name": "string", "CrossLanguageDefinitionId": "TypeSpec.string", @@ -1695,12 +1829,12 @@ "Decorators": [] }, { - "$id": "193", + "$id": "216", "Name": "resourceGroupName", "NameInRequest": "resourceGroupName", "Description": "The name of the resource group. The name is case insensitive.", "Type": { - "$id": "194", + "$id": "217", "Kind": "string", "Name": "string", "CrossLanguageDefinitionId": "TypeSpec.string", @@ -1716,12 +1850,12 @@ "Decorators": [] }, { - "$id": "195", + "$id": "218", "Name": "fooName", "NameInRequest": "fooName", "Description": "The name of the Foo", "Type": { - "$id": "196", + "$id": "219", "Kind": "string", "Name": "string", "CrossLanguageDefinitionId": "TypeSpec.string", @@ -1737,14 +1871,14 @@ "Decorators": [] }, { - "$id": "197", + "$id": "220", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "198", + "$id": "221", "Kind": "constant", "ValueType": { - "$id": "199", + "$id": "222", "Kind": "string", "Name": "string", "CrossLanguageDefinitionId": "TypeSpec.string", @@ -1765,7 +1899,7 @@ ], "Responses": [ { - "$id": "200", + "$id": "223", "StatusCodes": [ 200 ], @@ -1788,10 +1922,94 @@ "GenerateProtocolMethod": true, "GenerateConvenienceMethod": true, "CrossLanguageDefinitionId": "MgmtTypeSpec.Foos.get", - "Decorators": [] + "Decorators": [], + "Examples": [ + { + "$id": "224", + "kind": "http", + "name": "Get a foo", + "description": "Get a foo", + "filePath": "2024-05-01/Foos_Get.json", + "rawExample": { + "$id": "225", + "operationId": "Foos_Get", + "title": "Get a foo", + "parameters": { + "$id": "226", + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "resourceGroupName": "myRg", + "fooName": "myFoo" + }, + "responses": { + "200": { + "$id": "228", + "body": { + "$id": "229", + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRg/providers/MgmtTypeSpec/foos/myFoo", + "name": "myFoo", + "type": "MgmtTypeSpec/foos", + "properties": { + "$id": "230", + "serviceUrl": "https://myService.com", + "something": "for test only" + } + } + }, + "$id": "227" + } + }, + "parameters": [ + { + "$id": "231", + "parameter": { + "$ref": "213" + }, + "value": { + "$id": "232", + "kind": "string", + "type": { + "$ref": "214" + }, + "value": "00000000-0000-0000-0000-000000000000" + } + }, + { + "$id": "233", + "parameter": { + "$ref": "216" + }, + "value": { + "$id": "234", + "kind": "string", + "type": { + "$ref": "217" + }, + "value": "myRg" + } + }, + { + "$id": "235", + "parameter": { + "$ref": "218" + }, + "value": { + "$id": "236", + "kind": "string", + "type": { + "$ref": "219" + }, + "value": "myFoo" + } + } + ], + "responses": { + "$id": "237" + } + } + ] }, { - "$id": "201", + "$id": "238", "Name": "delete", "ResourceName": "Foos", "Description": "Delete a Foo", @@ -1801,12 +2019,12 @@ "$ref": "155" }, { - "$id": "202", + "$id": "239", "Name": "apiVersion", "NameInRequest": "api-version", "Description": "The API version to use for this operation.", "Type": { - "$id": "203", + "$id": "240", "Kind": "string", "Name": "string", "CrossLanguageDefinitionId": "TypeSpec.string", @@ -1820,29 +2038,29 @@ "IsRequired": true, "Kind": "Client", "DefaultValue": { - "$id": "204", + "$id": "241", "Type": { - "$id": "205", + "$id": "242", "Kind": "string", "Name": "string", "CrossLanguageDefinitionId": "TypeSpec.string" }, - "Value": "v1" + "Value": "2024-05-01" }, "Decorators": [] }, { - "$id": "206", + "$id": "243", "Name": "subscriptionId", "NameInRequest": "subscriptionId", "Description": "The ID of the target subscription. The value must be an UUID.", "Type": { - "$id": "207", + "$id": "244", "Kind": "string", "Name": "uuid", "CrossLanguageDefinitionId": "Azure.Core.uuid", "BaseType": { - "$id": "208", + "$id": "245", "Kind": "string", "Name": "string", "CrossLanguageDefinitionId": "TypeSpec.string", @@ -1860,12 +2078,12 @@ "Decorators": [] }, { - "$id": "209", + "$id": "246", "Name": "resourceGroupName", "NameInRequest": "resourceGroupName", "Description": "The name of the resource group. The name is case insensitive.", "Type": { - "$id": "210", + "$id": "247", "Kind": "string", "Name": "string", "CrossLanguageDefinitionId": "TypeSpec.string", @@ -1881,12 +2099,12 @@ "Decorators": [] }, { - "$id": "211", + "$id": "248", "Name": "fooName", "NameInRequest": "fooName", "Description": "The name of the Foo", "Type": { - "$id": "212", + "$id": "249", "Kind": "string", "Name": "string", "CrossLanguageDefinitionId": "TypeSpec.string", @@ -1902,14 +2120,14 @@ "Decorators": [] }, { - "$id": "213", + "$id": "250", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "214", + "$id": "251", "Kind": "constant", "ValueType": { - "$id": "215", + "$id": "252", "Kind": "string", "Name": "string", "CrossLanguageDefinitionId": "TypeSpec.string", @@ -1930,19 +2148,19 @@ ], "Responses": [ { - "$id": "216", + "$id": "253", "StatusCodes": [ 202 ], "BodyMediaType": "Json", "Headers": [ { - "$id": "217", + "$id": "254", "Name": "location", "NameInResponse": "Location", "Description": "The Location header contains the URL where the status of the long running operation can be checked.", "Type": { - "$id": "218", + "$id": "255", "Kind": "string", "Name": "string", "CrossLanguageDefinitionId": "TypeSpec.string", @@ -1950,12 +2168,12 @@ } }, { - "$id": "219", + "$id": "256", "Name": "retryAfter", "NameInResponse": "Retry-After", "Description": "The Retry-After header can indicate how long the client should wait before polling the operation status.", "Type": { - "$id": "220", + "$id": "257", "Kind": "int32", "Name": "int32", "CrossLanguageDefinitionId": "TypeSpec.int32", @@ -1966,7 +2184,7 @@ "IsErrorResponse": false }, { - "$id": "221", + "$id": "258", "StatusCodes": [ 204 ], @@ -1981,10 +2199,10 @@ "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/MgmtTypeSpec/foos/{fooName}", "BufferResponse": true, "LongRunning": { - "$id": "222", + "$id": "259", "FinalStateVia": 1, "FinalResponse": { - "$id": "223", + "$id": "260", "StatusCodes": [ 204 ], @@ -1997,7 +2215,7 @@ "Decorators": [] }, { - "$id": "224", + "$id": "261", "Name": "list", "ResourceName": "Foo", "Description": "List Foo resources by resource group", @@ -2007,12 +2225,12 @@ "$ref": "155" }, { - "$id": "225", + "$id": "262", "Name": "apiVersion", "NameInRequest": "api-version", "Description": "The API version to use for this operation.", "Type": { - "$id": "226", + "$id": "263", "Kind": "string", "Name": "string", "CrossLanguageDefinitionId": "TypeSpec.string", @@ -2026,29 +2244,29 @@ "IsRequired": true, "Kind": "Client", "DefaultValue": { - "$id": "227", + "$id": "264", "Type": { - "$id": "228", + "$id": "265", "Kind": "string", "Name": "string", "CrossLanguageDefinitionId": "TypeSpec.string" }, - "Value": "v1" + "Value": "2024-05-01" }, "Decorators": [] }, { - "$id": "229", + "$id": "266", "Name": "subscriptionId", "NameInRequest": "subscriptionId", "Description": "The ID of the target subscription. The value must be an UUID.", "Type": { - "$id": "230", + "$id": "267", "Kind": "string", "Name": "uuid", "CrossLanguageDefinitionId": "Azure.Core.uuid", "BaseType": { - "$id": "231", + "$id": "268", "Kind": "string", "Name": "string", "CrossLanguageDefinitionId": "TypeSpec.string", @@ -2066,12 +2284,12 @@ "Decorators": [] }, { - "$id": "232", + "$id": "269", "Name": "resourceGroupName", "NameInRequest": "resourceGroupName", "Description": "The name of the resource group. The name is case insensitive.", "Type": { - "$id": "233", + "$id": "270", "Kind": "string", "Name": "string", "CrossLanguageDefinitionId": "TypeSpec.string", @@ -2087,14 +2305,14 @@ "Decorators": [] }, { - "$id": "234", + "$id": "271", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "235", + "$id": "272", "Kind": "constant", "ValueType": { - "$id": "236", + "$id": "273", "Kind": "string", "Name": "string", "CrossLanguageDefinitionId": "TypeSpec.string", @@ -2115,7 +2333,7 @@ ], "Responses": [ { - "$id": "237", + "$id": "274", "StatusCodes": [ 200 ], @@ -2136,7 +2354,7 @@ "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/MgmtTypeSpec/foos", "BufferResponse": true, "Paging": { - "$id": "238", + "$id": "275", "ItemName": "value", "NextLinkName": "nextLink" }, @@ -2147,7 +2365,7 @@ } ], "Protocol": { - "$id": "239" + "$id": "276" }, "Parent": "MgmtTypeSpecClient", "Parameters": [ @@ -2159,9 +2377,9 @@ } ], "Auth": { - "$id": "240", + "$id": "277", "OAuth2": { - "$id": "241", + "$id": "278", "Scopes": [ "user_impersonation" ] diff --git a/test/TestProjects/MgmtTypeSpec/tspconfig.yaml b/test/TestProjects/MgmtTypeSpec/tspconfig.yaml index bfa6f5ecbbe..31632a2b5d9 100644 --- a/test/TestProjects/MgmtTypeSpec/tspconfig.yaml +++ b/test/TestProjects/MgmtTypeSpec/tspconfig.yaml @@ -3,3 +3,4 @@ options: flavor: "azure" namespace: "MgmtTypeSpec" clear-output-folder: true + examples-dir: "{project-root}/examples"