Azure / typespec-azure

About TypeSpec Azure Libraries
https://azure.github.io/typespec-azure/
MIT License
11 stars 37 forks source link

[Bug]: [TCGC][ARM] client customization in client.tsp for ARM does not have sdkContext.arm=true #1049

Closed weidongxu-microsoft closed 3 months ago

weidongxu-microsoft commented 3 months ago

Describe the bug

Use case https://gist.github.com/weidongxu-microsoft/fa420c35cf0611a62a8d155771dd3425?permalink_comment_id=5095904#gistcomment-5095904

Customization in client.tsp for ARM would start with

@client({
  name: "AvsClient", 
  service: Microsoft.AVS
})
@useDependency(Microsoft.AVS.Versions.v2023_09_01)
namespace Customizations;

sdkContext.arm from TCGC would be false in this case.

PS: we cannot add @armProviderNamespace("Microsoft.AVS") on namespace in client.tsp, it would cause error

error: @azure-tools/typespec-azure-resource-manager/single-arm-provider - Only one @armProviderNamespace can be declared in a typespec spec at once. @ C:/github/azure-sdk-for-java/sdk/avs/azure-resourcemanager-avs/TempTypeSpecFiles/Microsoft.AVS/client.tsp

Reproduction

Use client.tsp like https://gist.github.com/weidongxu-microsoft/fa420c35cf0611a62a8d155771dd3425?permalink_comment_id=5095904#gistcomment-5095904 in https://github.com/Azure/azure-rest-api-specs/tree/main/specification/vmware/Microsoft.AVS

Checklist