ogen
ogen copied to clipboard
Scopes/Roles: Support logical "OR"
Description
According to an OpenAPI feature, it is possible to define a logical "OR" when describing security scopes. For example:
# User needs scope A OR B
security:
- Bearer:
- A
- Bearer:
- B
However, ogen eventually merges this into a flat array like this:
var operationRolesBearer = map[string][]string{
SomeOperation: []string{
"A",
"B",
},
}
There is no way to determine whether it was defined with an "AND" relationship or "OR".
I have a draft PR for this here, wondering if this would be the right approach? https://github.com/ogen-go/ogen/pull/1535