Skip to content

fix: add required service: to @client decorators in client-initialization specs#4054

Merged
tadelesh merged 2 commits intomainfrom
copilot/fix-azure-http-specs-test
Mar 17, 2026
Merged

fix: add required service: to @client decorators in client-initialization specs#4054
tadelesh merged 2 commits intomainfrom
copilot/fix-azure-http-specs-test

Conversation

Copy link
Contributor

Copilot AI commented Mar 17, 2026

TCGC now requires root @client declarations to specify service: <root_namespace>. The client-initialization/default and client-initialization/individually specs were missing this parameter on all their @client-decorated interfaces, causing validation errors.

Changes

  • default/main.tsp — Added service: to all 6 @client decorators (HeaderParamClient, MultipleParamsClient, MixedParamsClient, PathParamClient, ParamAliasClient, QueryParamClient)
  • individually/main.tsp — Added service: to all 6 @client decorators (IndividuallyNestedWith* variants)
@global.Azure.ClientGenerator.Core.client({
  name: "HeaderParamClient",
  service: global._Specs_.Azure.ClientGenerator.Core.ClientInitialization.DefaultClient,
})

The global. prefix is used to unambiguously resolve the service namespace from within the nested namespace scope.

Copilot AI and others added 2 commits March 17, 2026 02:53
…initialization specs

Co-authored-by: weidongxu-microsoft <53292327+weidongxu-microsoft@users.noreply.github.com>
@microsoft-github-policy-service microsoft-github-policy-service bot added the lib:azure-http-specs For issues/prs related to the @azure-tools/typespec-azure-http-specs package label Mar 17, 2026
@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 17, 2026

Open in StackBlitz

npm i https://pkg.pr.new/@azure-tools/azure-http-specs@4054

commit: 5a84fc5

@azure-sdk
Copy link
Collaborator

All changed packages have been documented.

  • @azure-tools/azure-http-specs
Show changes

@azure-tools/azure-http-specs - fix ✏️

Add required service: parameter to @client decorators in client-initialization spec files.

@azure-sdk
Copy link
Collaborator

You can try these changes here

🛝 Playground 🌐 Website

@tadelesh tadelesh added this pull request to the merge queue Mar 17, 2026
Merged via the queue into main with commit e31784c Mar 17, 2026
29 checks passed
@tadelesh tadelesh deleted the copilot/fix-azure-http-specs-test branch March 17, 2026 07:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lib:azure-http-specs For issues/prs related to the @azure-tools/typespec-azure-http-specs package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants