Skip to content

Use PascalCase for generated C# extensible enum members - #12623

Draft
Jorge Rangel (jorgerangel-msft) wants to merge 2 commits into
mainfrom
copilot/ensure-enum-members-naming-guidelines
Draft

Jorge Rangel (jorgerangel-msft) wants to merge 2 commits into
mainfrom
copilot/ensure-enum-members-naming-guidelines

Conversation

@jorgerangel-msft

@jorgerangel-msft Jorge Rangel (jorgerangel-msft) commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

The C# generator can emit extensible enum members in all caps, such as AND and OR. Generated names should follow .NET PascalCase conventions unless the member is marked exact.

  • Naming: Normalize uppercase words before removing separators, so NOT_FOUND becomes NotFound.
  • Compatibility: Preserve exact names, custom names, and previously published names. Fixed enums and serialized values are unchanged.
StringExtensibleEnum.And.ToString(); // "AND"
StringExtensibleEnum.OR.ToString();  // "OR"; the member name was marked exact

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
@microsoft-github-policy-service microsoft-github-policy-service Bot added the emitter:client:csharp Issue for the C# client emitter: @typespec/http-client-csharp label Nov 19, 2026
@jorgerangel-msft Jorge Rangel (jorgerangel-msft) changed the title [WIP] Ensure generated enums members follow Pascal case naming guidelines Use PascalCase for generated C# extensible enum members Nov 19, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

emitter:client:csharp Issue for the C# client emitter: @typespec/http-client-csharp

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ensure Generated Enums Members in Extensible Enums Follow Naming Guidelines

2 participants