Repository navigation
[http-client-csharp] Emit Obsolete attributes for deprecated APIs #12394
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
JoshLove-msft
merged 12 commits into
microsoft:main
from
JoshLove-msft:joshlove-msft-csharp-deprecation-attributes
Oct 26, 2026
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
2df4960
feat(http-client-csharp): emit obsolete attributes for deprecated APIs
JoshLove-msft b32c6bf
fix(http-client-csharp): deduplicate obsolete partial attributes
JoshLove-msft fb5bf95
fix(http-client-csharp): preserve combined deprecation metadata
JoshLove-msft 6a0f9dc
fix(http-client-csharp): deduplicate experimental partial attributes
JoshLove-msft 96f0a6e
fix(http-client-csharp): refresh deprecation after type identity updates
JoshLove-msft 7f98ceb
fix(http-client-csharp): preserve custom obsolete diagnostic IDs
JoshLove-msft 86cd139
fix(http-client-csharp): honor custom protocol diagnostic suppressions
JoshLove-msft 9b34b26
fix(http-client-csharp): reindex providers after identity changes
JoshLove-msft 60343df
fix(http-client-csharp): apply type identity changes atomically
JoshLove-msft 9932569
test(http-client-csharp): remove combined experimental deprecation test
JoshLove-msft 7291aa7
refactor(http-client-csharp): address deprecation review nits
JoshLove-msft 3ce1ba0
fix(http-client-csharp): preserve visitor method deprecation overrides
JoshLove-msft File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
...tData/ModelReaderWriterContextDefinitionTests/CustomObsoleteDiagnosticIdsAreSuppressed.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| // <auto-generated/> | ||
|
|
||
| #nullable disable | ||
|
|
||
| using System.ClientModel.Primitives; | ||
| using Sample.Models; | ||
|
|
||
| namespace Sample | ||
| { | ||
| #pragma warning disable OBS001 // global::Sample.Models.CustomizedObsoleteModel is obsolete and may be removed in future versions. | ||
| [global::System.ClientModel.Primitives.ModelReaderWriterBuildableAttribute(typeof(global::Sample.Models.CustomizedObsoleteModel))] | ||
| #pragma warning restore OBS001 // global::Sample.Models.CustomizedObsoleteModel is obsolete and may be removed in future versions. | ||
| [global::System.ClientModel.Primitives.ModelReaderWriterBuildableAttribute(typeof(global::Sample.Models.RegularModel))] | ||
| public partial class SampleContext : global::System.ClientModel.Primitives.ModelReaderWriterContext | ||
| { | ||
| } | ||
| } |
12 changes: 12 additions & 0 deletions
12
...ontextDefinitionTests/CustomObsoleteDiagnosticIdsAreSuppressed/CustomizedObsoleteModel.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the MIT License. | ||
|
|
||
| using System; | ||
|
|
||
| namespace Sample.Models | ||
| { | ||
| [Obsolete("Use Current instead.", DiagnosticId = "OBS001")] | ||
| public partial class CustomizedObsoleteModel | ||
| { | ||
| } | ||
| } |
20 changes: 20 additions & 0 deletions
20
...aderWriterContextDefinitionTests/ExperimentalObsoleteFrameworkTypesHaveAllSuppressions.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| // <auto-generated/> | ||
|
|
||
| #nullable disable | ||
|
|
||
| using System.ClientModel.Primitives; | ||
| using Microsoft.TypeSpec.Generator.ClientModel.Tests.Providers.Definitions; | ||
| using Sample.Models; | ||
|
|
||
| namespace Sample | ||
| { | ||
| #pragma warning disable FRAMEWORK001 // global::Microsoft.TypeSpec.Generator.ClientModel.Tests.Providers.Definitions.ModelReaderWriterContextDefinitionTests.ExperimentalObsoleteFrameworkType is experimental and may change in future versions. | ||
| #pragma warning disable CS0618 // global::Microsoft.TypeSpec.Generator.ClientModel.Tests.Providers.Definitions.ModelReaderWriterContextDefinitionTests.ExperimentalObsoleteFrameworkType is obsolete and may be removed in future versions. | ||
| [global::System.ClientModel.Primitives.ModelReaderWriterBuildableAttribute(typeof(global::Microsoft.TypeSpec.Generator.ClientModel.Tests.Providers.Definitions.ModelReaderWriterContextDefinitionTests.ExperimentalObsoleteFrameworkType))] | ||
| #pragma warning restore CS0618 // global::Microsoft.TypeSpec.Generator.ClientModel.Tests.Providers.Definitions.ModelReaderWriterContextDefinitionTests.ExperimentalObsoleteFrameworkType is obsolete and may be removed in future versions. | ||
| #pragma warning restore FRAMEWORK001 // global::Microsoft.TypeSpec.Generator.ClientModel.Tests.Providers.Definitions.ModelReaderWriterContextDefinitionTests.ExperimentalObsoleteFrameworkType is experimental and may change in future versions. | ||
| [global::System.ClientModel.Primitives.ModelReaderWriterBuildableAttribute(typeof(global::Sample.Models.ParentModel))] | ||
| public partial class SampleContext : global::System.ClientModel.Primitives.ModelReaderWriterContext | ||
| { | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.