microsoft / microsoft/typespec
Versioning library should support adding an auth type in a new version
Open
lib:versioning
- Dominant language
- Java
- Stars
- 5.9k
- Forks
- 394
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 104
Description
I could not find a way to specify that a service added a new authentication type in a new version. I tried:
```
@versioned(Versions)
@useAuth(
ApiKeyAuth |
@added(Versions.v2) OAuth2Auth<[
{
type: OAuth2FlowType.implicit,
authorizationUrl: "https://login.contoso.com/common/oauth2/v2.0/authorize",
scopes: ["https://widget.contoso.com/.default"],
}
]>
)
@service({
title: "Widget Service",
})
namespace DemoService;
enum Versions {
v1,
v2,
}
```
but this gives the error:
```
error invalid-decorator-location Cannot decorate expression.
```
Contributor guide
Assessment
This issue has not been assessed yet.