microsoft / microsoft/typespec

Versioning library should support adding an auth type in a new version

Open
#2,033 3 comments 0 reactions 0 assignees View on GitHub
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

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.