Repository navigation
Isolate C# back-compat parameter renaming from serialization - #12164
Open
Jorge Rangel (jorgerangel-msft) with Copilot wants to merge 6 commits into
Open
Jorge Rangel (jorgerangel-msft) with Copilot wants to merge 6 commits into
Jorge Rangel (jorgerangel-msft) with Copilot wants to merge 6 commits into
Conversation
|
Azure Pipelines: Successfully started running 1 pipeline(s). 1 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Copilot started work on behalf of
Jorge Rangel (jorgerangel-msft)
October 13, 2026 16:13
View session
Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com>
…ession Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix deserialization issue with renamed property in back-compat version
Isolate C# back-compat parameter renaming from serialization
Oct 13, 2026
Copilot started reviewing on behalf of
Jorge Rangel (jorgerangel-msft)
October 13, 2026 16:42
View session
commit: |
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused ownership change preserves public compatibility while comprehensive regression coverage verifies serialization correctness.
0 open findings
What changed in this PR
Isolates public constructor parameter renaming from internal serialization variables, preventing renamed Boolean and enum values from being discarded during deserialization.
Changes:
- Gives public input parameters independent variable expressions.
- Updates internal-constructor baselines.
- Adds back-compatibility, compilation, alias, and runtime deserialization coverage.
| File | Description |
|---|---|
ParameterProvider.cs |
Stops public input variants from sharing serialization variables. |
ParameterProviderTests.cs |
Verifies independent variable ownership. |
BackCompat_ConstructorSameTypedNonExactParameterIsRestoredWithExactRename.cs |
Updates internal-constructor baseline. |
BackCompat_ConstructorParameterRenameRestoredBySignatureMatch.cs |
Updates renamed-parameter baseline. |
BackCompat_ConstructorParameterPreservesDateTimeSuffix.cs |
Updates DateTime parameter baseline. |
BackCompat_ConstructorParameterChainedRenameRestoredBySignatureMatch.cs |
Updates chained-rename baseline. |
BackCompat_ConstructorParameterCasingAndRotationRestoredBySignatureMatch(Casing).cs |
Updates casing baseline. |
BackCompat_ConstructorNonExactParameterIsRestoredWithExactRename.cs |
Updates non-exact rename baseline. |
BackCompat_RenamedPropertiesKeepSerializationParameters(Previous)/MockInputModel.cs |
Defines the previous public contract. |
BackCompat_RenamedPropertiesKeepSerializationParameters(Custom)/MockInputModel.cs |
Defines retained compatibility aliases. |
BackCompat_RenamedPropertiesKeepSerializationParameters(Context).cs |
Supplies compilation test context. |
BackCompat_RenamedPropertiesKeepSerializationParameters.cs |
Captures expected deserializer output. |
SerializationCustomizationTests.cs |
Adds loaded-contract, control, compilation, and runtime regression tests. |
🧠 Review effort: Balanced
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Copilot started work on behalf of
Jorge Rangel (jorgerangel-msft)
October 13, 2026 16:45
View session
Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com>
Copilot started work on behalf of
Jorge Rangel (jorgerangel-msft)
October 13, 2026 16:57
View session
Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com>
Copilot started reviewing on behalf of
Jorge Rangel (jorgerangel-msft)
October 13, 2026 17:09
View session
Jorge Rangel (jorgerangel-msft)
approved these changes
Oct 13, 2026
Jorge Rangel (jorgerangel-msft)
left a comment
Contributor
There was a problem hiding this comment.
Copilot there's test failures we need to address. Ensure we rerun Generate.ps1 and all spector tests are passing:
ersioning.TypeChangedFrom.V1 -> /mnt/vss/_work/1/s/packages/http-client-csharp/generator/artifacts/bin/Versioning.TypeChangedFrom.V1/Debug/net8.0/Versioning.TypeChangedFrom.V1.dll
Failed PublicInputVariantPreservesVariableAndMetadata [17 ms]
Error Message:
Expected: same as <VariableExpression { Type = global::System.Collections.Generic.IList<string>, Declaration = Microsoft.TypeSpec.Generator.Primitives.CodeWriterDeclaration }>
But was: <VariableExpression { Type = global::System.Collections.Generic.IEnumerable<string>, Declaration = Microsoft.TypeSpec.Generator.Primitives.CodeWriterDeclaration }>
Stack Trace:
at Microsoft.TypeSpec.Generator.Tests.Providers.ParameterProviderTests.PublicInputVariantPreservesVariableAndMetadata() in /mnt/vss/_work/1/s/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/ParameterProviderTests.cs:line 229
1)
Copilot started work on behalf of
Jorge Rangel (jorgerangel-msft)
October 13, 2026 19:03
View session
Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com>
Copilot started work on behalf of
Jorge Rangel (jorgerangel-msft)
October 13, 2026 20:03
View session
Copilot started reviewing on behalf of
Jorge Rangel (jorgerangel-msft)
October 13, 2026 20:48
View session
Jorge Rangel (jorgerangel-msft)
marked this pull request as ready for review
October 13, 2026 20:51
Jorge Rangel (jorgerangel-msft)
requested review from
JoshLove-msft,
Jose Arriaga Maldonado (joseharriaga),
Jesse Squire (jsquire) and
m-nash
as code owners
October 13, 2026 20:51
This branch has not been deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

With a back-compat contract loaded, restoring historical public constructor names mutated variable expressions shared with serialization parameters. Azure management’s name-based constructor repair then discarded parsed Boolean/enum arguments, removed their declarations, and substituted defaults.
true/falsedeserialization. Update only affected internal-constructor baselines.The serialization path consistently retains the parsed value: