microsoft / microsoft/typespec

The scopes property of the OAuth2Flow models should be a map of string to string

Open
#1,113 5 comments 3 reactions 0 assignees View on GitHub
design:needed
Dominant language
Java
Stars
5.9k
Forks
394
Avg merge
1d 23h
Merged PRs (30d)
104

Description

The OAuth2Flow models are intended to represent [the various possible OAuth2 flow definitions in OpenAPI v3] (https://github.com/OAI/OpenAPI-Specification/blob/3.0.3/versions/3.0.3.md#oauth-flow-object), but all define the `scopes` property as `string[]` whereas in the OpenAPI v3 spec this is defined as `Map[string, string]`.

The result is that there is no way to provide the "description" of a scope, the value part of the map, and you wind up with a security definition with empty descriptions:
```
"securityDefinitions": {
"OAuth2Auth": {
"type": "oauth2",
"flow": "implicit",
"authorizationUrl": "https://api.example.com/oauth2/authorize",
"scopes": {
"https://management.azure.com/read": "",
"https://management.azure.com/write": ""
}
}
},
```

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.