Skip to content

Commit 6ee1968

Browse files
Make pipeline property virtual (Azure#49920)
* Make pipeline property virtual * regen
1 parent 8e101ec commit 6ee1968

File tree

243 files changed

+274
-245
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

243 files changed

+274
-245
lines changed

eng/Packages.Data.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,8 @@
206206
</ItemGroup>
207207

208208
<ItemGroup Condition="'$(IsGeneratorLibrary)' == 'true'">
209-
<PackageReference Update="Microsoft.TypeSpec.Generator.ClientModel" Version="1.0.0-alpha.20250507.1" />
210-
<PackageReference Update="Microsoft.TypeSpec.Generator.Input" Version="1.0.0-alpha.20250507.1" />
209+
<PackageReference Update="Microsoft.TypeSpec.Generator.ClientModel" Version="1.0.0-alpha.20250508.3" />
210+
<PackageReference Update="Microsoft.TypeSpec.Generator.Input" Version="1.0.0-alpha.20250508.3" />
211211
<PackageReference Update="Azure.Generator" Version="1.0.0-alpha.20250429.2" />
212212
<PackageReference Update="System.ClientModel" Version="1.4.0" />
213213
</ItemGroup>

eng/packages/http-client-csharp/generator/Azure.Generator/src/AzureClientGenerator.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,6 @@ protected override void Configure()
5151
AddSharedSourceDirectory(sharedSourceDirectory);
5252
AddVisitor(new NamespaceVisitor());
5353
AddVisitor(new DistributedTracingVisitor());
54+
AddVisitor(new PipelinePropertyVisitor());
5455
}
5556
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
4+
using Azure.Core.Pipeline;
5+
using Microsoft.TypeSpec.Generator.ClientModel;
6+
using Microsoft.TypeSpec.Generator.Primitives;
7+
using Microsoft.TypeSpec.Generator.Providers;
8+
9+
namespace Azure.Generator.Visitors
10+
{
11+
/// <summary>
12+
/// Makes the Pipeline property virtual for consistency and backwards compatibility with existing
13+
/// Azure libraries.
14+
/// </summary>
15+
internal class PipelinePropertyVisitor : ScmLibraryVisitor
16+
{
17+
protected override PropertyProvider? VisitProperty(PropertyProvider property)
18+
{
19+
if (property.Type.Equals(typeof(HttpPipeline)))
20+
{
21+
// Add the virtual modifier for the HttpPipeline property for backwards compatibility.
22+
property.Update(modifiers: property.Modifiers | MethodSignatureModifiers.Virtual);
23+
}
24+
25+
return property;
26+
}
27+
}
28+
}

eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/BasicTypeSpecClient.cs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/api-key/src/Generated/ApiKeyClient.cs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/http/custom/src/Generated/CustomClient.cs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/oauth2/src/Generated/OAuth2Client.cs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/union/src/Generated/UnionClient.cs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

eng/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/flatten-property/src/Generated/FlattenPropertyClient.cs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

eng/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/usage/src/Generated/ModelInOperation.cs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)