Update http-client-csharp-mgmt to latest azure generator and TypeSpec dependencies#56370
Merged
Update http-client-csharp-mgmt to latest azure generator and TypeSpec dependencies#56370
Conversation
…e generator Co-authored-by: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com>
…nt-name errors Co-authored-by: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update mgmt generator to latest azure generator and typespec dependencies
Update http-client-csharp-mgmt to latest azure generator and TypeSpec dependencies
Feb 20, 2026
Resolve conflict in eng/Packages.Data.props: take main's UnbrandedGeneratorVersion (1.0.0-alpha.20260220.2) and PR's AzureGeneratorVersion (1.0.0-alpha.20260219.1). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…edLocationOptional The @FriendlyName("ExtendedLocation") decorator on ExtendedLocationOptional in the ARM library conflicts with the actual ExtendedLocation type. Using @@clientName to override doesn't work because TCGC's getLibraryName() skips @@clientName when the override value equals type.name. Using @@FriendlyName to set the name back to "ExtendedLocationOptional" correctly resolves the conflict. Tracked upstream: Azure/typespec-azure#3925 Regenerated test projects to reflect the fix. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
f7c41ef to
0dd8059
Compare
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the http-client-csharp-mgmt generator to the latest @azure-typespec/http-client-csharp version (1.0.0-alpha.20260219.1) and synchronizes all TypeSpec dependencies with the azure generator. The update resolves duplicate-client-name diagnostics introduced by stricter validation in the updated TypeSpec client generator core.
Changes:
- Updated
@azure-typespec/http-client-csharpfrom 1.0.0-alpha.20260213.2 to 1.0.0-alpha.20260219.1 - Upgraded TypeSpec compiler and libraries from 1.8.x/0.78.x to 1.9.x/0.79.x, and Azure TypeSpec tools from 0.64.x to 0.65.x
- Added @@FriendlyName and @@clientName overrides in main.tsp to resolve naming conflicts with legacy ARM types (ExtendedLocationOptional and ManagedServiceIdentityType)
- Regenerated test project with generator updates: api-version parameters now optional with null checks, URI deserialization uses UriKind.RelativeOrAbsolute, and model names updated per TypeSpec overrides
Reviewed changes
Copilot reviewed 4 out of 79 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| eng/packages/http-client-csharp-mgmt/package.json | Updated dependency versions for azure generator and all TypeSpec packages; added @typespec/http-client-csharp devDependency to prevent type conflicts |
| eng/packages/http-client-csharp-mgmt/package-lock.json | Regenerated lock file reflecting dependency updates |
| eng/Packages.Data.props | Updated AzureGeneratorVersion to match package.json |
| eng/packages/http-client-csharp-mgmt/generator/TestProjects/Local/Mgmt-TypeSpec/main.tsp | Added @@FriendlyName and @@clientName decorators to resolve duplicate-client-name diagnostics from legacy ARM types |
| eng/packages/http-client-csharp-mgmt/generator/TestProjects/Local/Mgmt-TypeSpec/tspCodeModel.json | Updated api-version parameter from required to optional in method scope |
| eng/packages/http-client-csharp-mgmt/generator/TestProjects/Local/Mgmt-TypeSpec/src/Generated/RestOperations/*.cs | Added null checks before appending/updating api-version query parameters |
| eng/packages/http-client-csharp-mgmt/generator/TestProjects/Local/Mgmt-TypeSpec/src/Generated/Models/*Serialization.cs | Updated URI deserialization to use UriKind.RelativeOrAbsolute constructor parameter |
| eng/packages/http-client-csharp-mgmt/generator/TestProjects/Local/Mgmt-TypeSpec/src/Generated/Models/ExtendedLocationOptional.* | Renamed from ExtendedLocation1 to ExtendedLocationOptional per TypeSpec override |
| eng/packages/http-client-csharp-mgmt/generator/TestProjects/Local/Mgmt-TypeSpec/src/Generated/BestPracticeData.* | Updated to use ExtendedLocationOptional type |
| eng/packages/http-client-csharp-mgmt/generator/TestProjects/Local/Mgmt-TypeSpec/src/Generated/Models/AzureGeneratorMgmtTypeSpecTestsContext.cs | Updated ModelReaderWriter registration for renamed ExtendedLocationOptional |
| eng/packages/http-client-csharp-mgmt/generator/TestProjects/Local/Mgmt-TypeSpec/src/Generated/MgmtTypeSpecTestsModelFactory.cs | Updated factory method parameter type for ExtendedLocationOptional |
Take main's newer UnbrandedGeneratorVersion (1.0.0-alpha.20260223.4) and keep PR's AzureGeneratorVersion (1.0.0-alpha.20260219.1). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…agedServiceIdentityType override Since issue Azure/typespec-azure#3925 is by design, use @@clientName instead of @@FriendlyName to resolve the duplicate-client-name error. The @@clientName must use a name different from type.name due to TCGC's getLibraryName() skip logic. Removed @@clientName override for ManagedServiceIdentityType as it is not needed - no duplicate-client-name error occurs without it. Regenerated test projects (includes TCGC 0.65.3 api-version null check removal). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The override was incorrectly removed - it passed locally likely due to npm package hoisting differences but CI hits the duplicate-client-name error between Legacy and CommonTypes ManagedServiceIdentityType unions. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- @azure-typespec/http-client-csharp: 1.0.0-alpha.20260219.1 -> 1.0.0-alpha.20260223.1 - @typespec/http-client-csharp: 1.0.0-alpha.20260219.2 -> 1.0.0-alpha.20260223.4 - AzureGeneratorVersion in Packages.Data.props: 1.0.0-alpha.20260223.1 - azure-typespec-http-client-csharp-emitter-package: updated to match - azure-typespec-http-client-csharp-mgmt-emitter-package: updated all deps to 0.65.x/1.9.x - Regenerated test projects Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…enerator-dependencies
fb322ab to
ce6fb73
Compare
…n mgmt Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
ce6fb73 to
45e84ce
Compare
haiyuazhang
approved these changes
Feb 24, 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.
Update
http-client-csharp-mgmtgenerator dependencies to align with the latest TypeSpec ecosystem versions.Changes
Generator (
eng/packages/http-client-csharp-mgmt)package.json@azure-typespec/http-client-csharp:1.0.0-alpha.20260213.2->1.0.0-alpha.20260219.1@typespec/http-client-csharp: added pin at1.0.0-alpha.20260219.2(devDependency)@azure-tools/typespec-client-generator-core:0.64.4->0.65.3@azure-tools/typespec-liftr-base:0.11.0->0.12.0@typespec/compiler1.8->1.9,@typespec/rest/versioning/xml/streams0.78->0.79,@azure-tools/typespec-*0.64->0.65package-lock.json: regenerated vianpm installEmitter version (
eng/)eng/Packages.Data.props:AzureGeneratorVersion1.0.0-alpha.20260213.2->1.0.0-alpha.20260219.1Test project fixes
generator/TestProjects/Local/Mgmt-TypeSpec/main.tsp: Added@@clientNameoverrides forAzure.ResourceManager.Legacy.ExtendedLocationOptionalandAzure.ResourceManager.Legacy.ManagedServiceIdentityTypeto resolveduplicate-client-nameerrors introduced by the stricter@azure-tools/typespec-client-generator-core@0.65.xvalidationRegenerated test project (
Mgmt-TypeSpec/src/Generated/) to reflect code model changes from the updated generator