Repository navigation
Fix IPv4 and IPv6 casing in generated C# parameters - #11673
Merged
Merged
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)
August 14, 2026 16:56
View session
Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com>
Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix acronym casing in generated parameters
Fix IPv4 and IPv6 casing in generated C# parameters
Aug 14, 2026
Co-authored-by: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com>
Co-authored-by: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com>
JoshLove-msft
marked this pull request as ready for review
August 14, 2026 19:04
JoshLove-msft
requested review from
Jose Arriaga Maldonado (joseharriaga),
Jesse Squire (jsquire) and
m-nash
as code owners
August 14, 2026 19:04
Copilot started reviewing on behalf of
Jorge Rangel (jorgerangel-msft)
August 14, 2026 19:14
View session
commit: |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a casing regression in the C# generator where property-derived parameter variable names for IPv4/IPv6 were being emitted as iPv4/iPv6 instead of the expected ipv4/ipv6, aligning parameter casing with normalized property names (e.g., IPv4, IPv6).
Changes:
- Add a targeted IPv4/IPv6 post-normalization step in
ToVariableNameto rewrite leadingiPv4/iPv6toipv4/ipv6only at word boundaries. - Add regression tests covering IPv4/IPv6, standard acronym behavior, exact-name scenarios, and non-leading/non-boundary cases.
- Minor formatting fix in an existing test update expression (
& ~).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/PropertyProviderTests.cs | Adds coverage verifying property-derived parameter declarations normalize IPv4/IPv6 and common acronym casing; includes a small formatting correction. |
| packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.Input/test/StringExtensionsTests.cs | Adds unit tests for ToVariableName behavior specific to IPv4/IPv6 casing and boundary/non-boundary cases. |
| packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.Input/src/Extensions/StringExtensions.cs | Implements the IPv4/IPv6 leading-acronym casing correction in ToVariableName after identifier normalization. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Jorge Rangel (jorgerangel-msft)
approved these changes
Aug 14, 2026
JoshLove-msft
approved these changes
Aug 14, 2026
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.
Property-derived C# parameters were emitted as
iPv4andiPv6instead of matching the normalizedIPv4andIPv6property names.