Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
4 tasks done
weidongxu-microsoft opened this issue Jun 21, 2024 · 0 comments · Fixed by #1050
Closed
4 tasks done
Labels
bug Something isn't working lib:tcgc Issues for @azure-tools/typespec-client-generator-core library

Comments

@weidongxu-microsoft
Copy link
Member

weidongxu-microsoft commented Jun 21, 2024

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

  • Follow our Code of Conduct
  • Check that this issue is about the Azure libraries for typespec. For bug in the typespec language or core libraries file it in the TypeSpec repo
  • Check that there isn't already an issue that request the same bug to avoid creating a duplicate.
  • The provided reproduction is a minimal reproducible example of the bug.
@weidongxu-microsoft weidongxu-microsoft added the bug Something isn't working label Jun 21, 2024
@weidongxu-microsoft weidongxu-microsoft changed the title [Bug]: [TCGC] client customization in client.tsp for ARM does not have sdkContext.arm=true [Bug]: [TCGC][ARM] client customization in client.tsp for ARM does not have sdkContext.arm=true Jun 21, 2024
@tadelesh tadelesh added lib:tcgc Issues for @azure-tools/typespec-client-generator-core library and removed needs-area labels Jun 24, 2024
github-merge-queue bot pushed a commit that referenced this issue Jun 24, 2024
cause: `SdkContext.arm` is not set, in the case of explicit client.

fix #1049

---------

Co-authored-by: Chenjie Shi <tadelesh.shi@live.cn>
markcowl pushed a commit to markcowl/typespec-azure that referenced this issue Jun 26, 2024
cause: `SdkContext.arm` is not set, in the case of explicit client.

fix Azure#1049

---------

Co-authored-by: Chenjie Shi <tadelesh.shi@live.cn>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working lib:tcgc Issues for @azure-tools/typespec-client-generator-core library
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants