-
Notifications
You must be signed in to change notification settings - Fork 299
Open
Labels
Milestone
Description
Clear and concise description of the problem
When you have multiple flows in an OAuth2Auth
object with scopes this results in duplicate scopes in the generated openapi.yaml
Like so
security:
- oauth:
- api:read
- api:read
with the tsp as follows:
model oauth<Scopes extends string[]>
is OAuth2Auth<
[
{
type: OAuth2FlowType.authorizationCode;
authorizationUrl: "https://example.org/oauth2/v2.0/authorize";
tokenUrl: "https://example.org/oauth2/v2.0/token";
refreshUrl: "https://example.org/oauth2/v2.0/token";
},
{
type: OAuth2FlowType.clientCredentials;
tokenUrl: "https://example.org/oauth2/v2.0/token";
}
],
Scopes
>;
model Get200Response {
@statusCode statusCode: 200;
@bodyRoot body: int64;
}
@route("/example")
@get
@useAuth(oauth<["api:read"]>)
op Get(): Get200Response
I'd like it if they were de-duplicated since this also results in them showing up twice or even more times in the generated documentation.
Checklist
- Follow our Code of Conduct
- Read the docs.
- Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
Copilot