-
Notifications
You must be signed in to change notification settings - Fork 383
Preserve generated model operator parameter names #11670
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
Draft
Copilot
wants to merge
11
commits into
main
Choose a base branch
from
copilot/handle-back-compat-model-operators
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
7da23ee
Initial plan
Copilot d0ffddc
fix(http-client-csharp): preserve model operator parameter names
Copilot 24e87c3
fix(http-client-csharp): apply backcompat to serialization providers
Copilot 73c4006
fix(http-client-csharp): process partial methods once for backcompat
Copilot a9dab1d
docs(http-client-csharp): clarify partial backcompat scope
Copilot 23bf62f
fix(http-client-csharp): scope serialization backcompat to operators
Copilot 1aded1e
docs(http-client-csharp): clarify operator backcompat mutation
Copilot 9bd6624
fix(http-client-csharp): move serialization backcompat to scm output …
Copilot 1c7536a
test(http-client-csharp): add serialization provider back-compat oper…
Copilot c387cf8
fix(http-client-csharp): process serialization back-compat in CSharpG…
Copilot ec58d8a
test(http-client-csharp): add implicit operator back-compat coverage
Copilot 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
Some comments aren't visible on the classic Files Changed page.
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
21 changes: 21 additions & 0 deletions
21
...finitionTests/ExplicitClientResultOperatorKeepsCurrentParameterNameWithoutLastContract.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,21 @@ | ||
| // <auto-generated/> | ||
|
|
||
| #nullable disable | ||
|
|
||
| using System.ClientModel; | ||
| using System.ClientModel.Primitives; | ||
| using System.Text.Json; | ||
| using Sample.Models; | ||
|
|
||
| namespace Sample | ||
| { | ||
| public partial class MockInputModel | ||
| { | ||
| public static explicit operator MockInputModel(global::System.ClientModel.ClientResult response) | ||
| { | ||
| global::System.ClientModel.Primitives.PipelineResponse response0 = response.GetRawResponse(); | ||
| using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(response0.Content, global::Sample.ModelSerializationExtensions.JsonDocumentOptions); | ||
| return global::Sample.Models.MockInputModel.DeserializeMockInputModel(document.RootElement, global::Sample.ModelSerializationExtensions.WireOptions); | ||
| } | ||
| } | ||
| } | ||
21 changes: 21 additions & 0 deletions
21
...tionTypeDefinitionTests/ExplicitClientResultOperatorPreservesLastContractParameterName.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,21 @@ | ||
| // <auto-generated/> | ||
|
|
||
| #nullable disable | ||
|
|
||
| using System.ClientModel; | ||
| using System.ClientModel.Primitives; | ||
| using System.Text.Json; | ||
| using Sample.Models; | ||
|
|
||
| namespace Sample | ||
| { | ||
| public partial class MockInputModel | ||
| { | ||
| public static explicit operator MockInputModel(global::System.ClientModel.ClientResult result) | ||
| { | ||
| global::System.ClientModel.Primitives.PipelineResponse response = result.GetRawResponse(); | ||
| using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(response.Content, global::Sample.ModelSerializationExtensions.JsonDocumentOptions); | ||
| return global::Sample.Models.MockInputModel.DeserializeMockInputModel(document.RootElement, global::Sample.ModelSerializationExtensions.WireOptions); | ||
| } | ||
| } | ||
| } |
9 changes: 9 additions & 0 deletions
9
...ionTests/ExplicitClientResultOperatorPreservesLastContractParameterName/MockInputModel.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,9 @@ | ||
| using System.ClientModel; | ||
|
|
||
| namespace Sample.Models | ||
| { | ||
| public partial class MockInputModel | ||
| { | ||
| public static explicit operator MockInputModel(ClientResult result) => throw null; | ||
| } | ||
| } |
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
14 changes: 14 additions & 0 deletions
14
...ethodsForBackCompatibilityRestoresImplicitOperatorParameterNameOnSerializationProvider.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,14 @@ | ||
| // <auto-generated/> | ||
|
|
||
| #nullable disable | ||
|
|
||
| namespace Test | ||
| { | ||
| public partial class SerializationImplicitBackCompatType | ||
| { | ||
| public static implicit operator string(global::Test.SerializationImplicitBackCompatType published) | ||
| { | ||
| return null; | ||
| } | ||
| } | ||
| } |
7 changes: 7 additions & 0 deletions
7
...plicitOperatorParameterNameOnSerializationProvider/SerializationImplicitBackCompatType.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,7 @@ | ||
| namespace Test | ||
| { | ||
| public partial class SerializationImplicitBackCompatType | ||
| { | ||
| public static implicit operator string(SerializationImplicitBackCompatType published) => null; | ||
| } | ||
| } |
14 changes: 14 additions & 0 deletions
14
...s/BuildMethodsForBackCompatibilityRestoresOperatorParameterNameOnSerializationProvider.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,14 @@ | ||
| // <auto-generated/> | ||
|
|
||
| #nullable disable | ||
|
|
||
| namespace Test | ||
| { | ||
| public partial class SerializationBackCompatType | ||
| { | ||
| public static explicit operator SerializationBackCompatType(string result) | ||
| { | ||
| return null; | ||
| } | ||
| } | ||
| } |
7 changes: 7 additions & 0 deletions
7
...bilityRestoresOperatorParameterNameOnSerializationProvider/SerializationBackCompatType.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,7 @@ | ||
| namespace Test | ||
| { | ||
| public partial class SerializationBackCompatType | ||
| { | ||
| public static explicit operator SerializationBackCompatType(string result) => null; | ||
| } | ||
| } |
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.
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.