microsoft / microsoft/typespec
The scopes property of the OAuth2Flow models should be a map of string to string
- 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
Assessment
This issue has not been assessed yet.