Skip to content

[http-client-csharp] Normalize acronyms in ordinary operation parameter names #12071

Description

@JoshLove-msft

Summary

Extend acronym normalization to ordinary operation parameters. Property-derived constructor/model-factory parameters already benefit from normalized property names and IPv4/IPv6 camel-casing; that does not cover parameters originating directly from an operation.

Follow-up to Azure/azure-sdk-for-net#61944 and #11641. Related prior work: #11673, #11714, and #11719.

Current implementation

Source inspected at 9ab53f765aca1c27b623c7e5775eb9929272ec39:

  • operation-converter.ts passes parameter names and isExactName through to the input model.
  • ParameterProvider(InputParameter) retains the input name except for typed date/time naming; it does not apply general acronym normalization.
  • TypeFactory.CreateParameterCore is a protected virtual factory hook, but compatibility decisions also need the enclosing method/contract context.
  • PropertyProvider.AsParameter follows a different path: normalized property name followed by ToVariableName().

Desired behavior

For new, non-exact operation parameters without a matching previous public signature, names such as sourceIpAddress, targetDbName, and guestOsType should become sourceIPAddress, targetDBName, and guestOSType.

Preserve valid camelCase at the beginning: ipAddress, dbName, osType, ipv4Address, and ipv6Address must not become PascalCase. Previously shipped or exact iPv4/iPv6 names must remain unchanged. These are source-derived examples rather than executed generation results.

Acceptance criteria

  • Reuse the same boundary-aware rules as other supported symbol surfaces, with correct camelCase conversion for parameters.
  • Cover ordinary query/path/header/body method parameters and their protocol/convenience and sync/async projections; do not apply public-name normalization to serialized wire names.
  • Preserve exact names, custom signatures, and last-contract parameter names, including existing model-factory/constructor compatibility behavior. Parameter names matter to named-argument source compatibility.
  • Keep argument references, request mappings, spread/grouped parameter mappings, validation code, and XML parameter documentation consistent with emitted signatures.
  • Add extensive tests for leading and embedded acronyms, IPv4/IPv6, repeated occurrences, negative boundaries, canonical spellings, exact/customized/published signatures, and method variants.
  • Keep already-supported property-derived parameter naming working; do not reinterpret legacy names as new-contract names.

Scope boundary

Management also creates parameters directly from resource path metadata and applies a separate body-name fallback. Those paths bypass the shared input-parameter factory and need management-specific follow-ups under Azure/azure-sdk-for-net#61944.

Activity

  1. github-actions commented on Sep 29, 2026

    @github-actions
    Contributor

    🎯 Issue Triage
    This feature request extends shared C# client emitter acronym normalization to ordinary operation parameters while preserving camelCase, exact names, and published signatures.
    It covers all method projections and parameter locations without changing serialized wire names or existing property-derived behavior.
    Category: Feature Request
    Area: emitter:client:csharp

    🔍 Analysis

    operation-converter.ts carries operation parameter names and isExactName into the input model, while ParameterProvider(InputParameter) does not apply the shared boundary-aware acronym normalizer. The final name must be chosen with method/contract context so exact, customized, and last-contract signatures remain source-compatible, and every declaration/reference surface (arguments, request mappings, validation, and XML docs) uses the same result.

    Related work is complementary rather than duplicative: #11672 fixed IPv4/IPv6 casing, and #11707/#11714 addressed compatibility for parameters synthesized from model properties. This issue targets parameters originating directly from operations. Management-only resource-path and body fallback parameters remain explicitly out of scope.

    📝 Suggested next steps
    • Add focused tests for query, path, header, and body parameters across convenience/protocol and sync/async variants.
    • Apply shared normalization only after exact/custom/last-contract preservation is resolved.
    • Verify signature references, mappings, validation, documentation, and serialized names remain consistent.

    Generated by Agentic Triage

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

Metadata

Metadata

Labels

emitter:client:csharpIssue for the C# client emitter: @typespec/http-client-csharpfeatureNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions