ogen icon indicating copy to clipboard operation
ogen copied to clipboard

Scopes/Roles: Support logical "OR"

Open denchenko opened this issue 5 months ago • 1 comments

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".

denchenko avatar Aug 12 '25 15:08 denchenko

I have a draft PR for this here, wondering if this would be the right approach? https://github.com/ogen-go/ogen/pull/1535

dtjm avatar Sep 25 '25 20:09 dtjm