Azure / Azure/typespec-azure

[TCGC] `__raw` of `SdkCredentialType` is the `namespace` instead of the decorator itself

Open
#2,232 1 comment 0 reactions 1 assignee Claimed by @tadelesh View on GitHub
lib:tcgc
Dominant language
TypeScript
Stars
27
Forks
90
Avg merge
1d 22h
Merged PRs (30d)
156

Description

As we all know, `SdkCredentialType` corresponds to the `@useAuth` decorator, but its `__raw` is the namespace with that decorator instead of the decorator itself.
This would lead to when we want to report something wrong for the auth, the diagnostic will show up on the namespace instead of the auth itself.
![Image](https://github.com/user-attachments/assets/130a9a06-1617-4baa-affa-97ba7be615cf)
This would be so confusing because in a lot of cases, the target of a decorator could be in a different file from the decorator itself.

For instance, if we have:
```
@useAuth(ApiKeyAuth)
namespace Service;
```
We should have the raw corresponding to the `ApiKeyAuth` part, or at least the decorator itself.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.