Conversation
- Add apiVersionsMap property to SdkClientType interface - Update getOrCreateClients to create separate root client per service (Scenario 0) - Update prepareClientAndOperationCache for nested @client support - Update hasExplicitClientOrOperationGroup for nested @client detection - Update handleVersioningMutationForGlobalNamespace for multiple scenarios - Fix existing tests for new behavior Co-authored-by: tadelesh <1726438+tadelesh@users.noreply.github.com>
…tests - Add isNamespaceEmpty and serviceHasOperationGroupDecorators helpers - Support auto-merge for single-service client with empty namespace (Scenario 1) - Handle mixed multi-service and single-service versioning (Scenario 1.5) - Add forceImplicit flag to createOperationGroup for auto-merge - Add tests for Scenarios 0, 1, 1.5 and apiVersionsMap Co-authored-by: tadelesh <1726438+tadelesh@users.noreply.github.com>
- Filter nested clients within multi-service parents from root client list - Create operation groups for nested @client decorators in multi-service parents - Support auto-merge of service content into empty nested client namespaces - Add test for Scenario 2: services as direct children with nested @client Co-authored-by: tadelesh <1726438+tadelesh@users.noreply.github.com>
…add changeset, format code - Fix redundant ternary operators in cache.ts and internal-utils.ts - Add changeset describing feature and breaking change migration guide - Format code with pnpm format - All 1183 tests pass (7 new + 1176 existing) Co-authored-by: tadelesh <1726438+tadelesh@users.noreply.github.com>
commit: |
tadelesh
left a comment
There was a problem hiding this comment.
@copilot You need to handle the missing part from https://github.com/Azure/typespec-azure/blob/main/packages/typespec-client-generator-core/design-docs/client.md which is consolidating the @client and @operationGroup. You need to deprecate the @operationGroup and instead all client related customization should use @client. Also, you need to check all related logic especially in cache.ts and decorator.ts to ensure a smooth migration experience.
Switch compile() to compileAndDiagnose() in tests that use @operationGroup in their TypeSpec code, since the #deprecated annotation on @operationGroup now produces a diagnostic warning that causes compile() to fail. For tests already using compileAndDiagnose(), filter out the 'deprecated' diagnostic before diagnostic assertions. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: tadelesh <1726438+tadelesh@users.noreply.github.com>
|
@copilot You need to handle the missing part from https://github.com/Azure/typespec-azure/blob/main/packages/typespec-client-generator-core/design-docs/client.md which is consolidating the |
Co-authored-by: tadelesh <1726438+tadelesh@users.noreply.github.com>
Resolved in |
|
@copilot Please check the changes you made to make sure they all follow two client doc design doc and make sure all tests could pass. |
|
@copilot Please check the changes you made to make sure they all follow two client doc design doc and make sure all tests could pass. |
Rechecked against both client design docs ( |
|
@copilot You also need to update the samples under |
Co-authored-by: tadelesh <1726438+tadelesh@users.noreply.github.com>
Done in |
Co-authored-by: tadelesh <1726438+tadelesh@users.noreply.github.com>
Resolved in |
Co-authored-by: tadelesh <1726438+tadelesh@users.noreply.github.com>
Resolved in |
Implemented the multiple-services design updates and completed consolidation work from
design-docs/client.mdanddesign-docs/multiple-services.mdfor@clientand@operationGroup.What’s included
apiVersionsMaptoSdkClientTypeand populated it for cross-service clients.@servicewithout explicit@clientcreates separate root clients.@client.hasExplicitClientOrOperationGroup) for nested client cases.Consolidation of
@clientand@operationGroupAddressed the missing consolidation piece requested in review:
@operationGroupis deprecated indecorators.tsp.$operationGroupnow delegates directly tocontext.call($client, target, undefined, scope).clientstate.clientstate path.SdkOperationGroupis deprecated ininterfaces.tsin favor ofSdkClient-based nested hierarchy customization.@clientwith multiple services auto-merging recursively.Sample updates in
packages/azure-http-specsTo align samples with the consolidation direction, updated specs under
packages/azure-http-specsto replace@operationGroupusages with@client:specs/client/structure/client-operation-group/client.tspspecs/client/structure/two-operation-group/client.tspspecs/client/structure/renamed-operation/client.tspspecs/client/structure/common/service.tsp(description text updated)specs/client/naming/main.tspspecs/client/naming/enum-conflict/main.tspspecs/azure/core/scalar/main.tspspecs/azure/core/model/main.tspRegenerated artifacts/docs
Because decorator source changed, regenerated and committed:
generated-defs/Azure.ClientGenerator.Core.tspackages/typespec-client-generator-core/README.mdwebsite/.../reference/decorators.mdChangeset update
Updated changesets to match review guidance:
breaking@operationGroupandSdkOperationGroupdeprecation/migration context@azure-tools/azure-http-specssample migration updatesValidation
typespec-client-generator-coretests pass: 1184 passed, 2 skipped.azure-http-specssample files compile withtsp compile --no-emit.💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.