Skip to content

Commit

Permalink
tcgc, arm, set context.arm for explicit client (Azure#1050)
Browse files Browse the repository at this point in the history
cause: `SdkContext.arm` is not set, in the case of explicit client.

fix Azure#1049

---------

Co-authored-by: Chenjie Shi <tadelesh.shi@live.cn>
  • Loading branch information
2 people authored and markcowl committed Jun 26, 2024
1 parent 139b075 commit 7697abb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
changeKind: fix
packages:
- "@azure-tools/typespec-client-generator-core"
---

Fix SdkContext.arm
3 changes: 3 additions & 0 deletions packages/typespec-client-generator-core/src/decorators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,9 @@ export function listClients(context: TCGCContext): SdkClient[] {
const explicitClients = [...listScopedDecoratorData(context, clientKey)];
if (explicitClients.length > 0) {
context.__rawClients = getClientsWithVersioning(context, explicitClients);
if (context.__rawClients.some((client) => isArm(client.service))) {
context.arm = true;
}
return context.__rawClients;
}

Expand Down

0 comments on commit 7697abb

Please sign in to comment.