Skip to content

[tooling] Enforce openapi scopes generator order#1369

Open
the-glu wants to merge 1 commit intointeruss:masterfrom
Orbitalize:consistant_openapi_generator
Open

[tooling] Enforce openapi scopes generator order#1369
the-glu wants to merge 1 commit intointeruss:masterfrom
Orbitalize:consistant_openapi_generator

Conversation

@the-glu
Copy link
Contributor

@the-glu the-glu commented Feb 11, 2026

The openapi-to-go-server return a unordered set of scopes, meaning that we get random unrelated changes everytime we build the API.

(Example: de42be0#diff-bb21552cc2d287b0949b37cae5b6dcf993eae2b0ca31a1e0e63f0dca8fbcd606L10 )

This PR enforce sorting to ensure stable generation of interface files.

@the-glu the-glu changed the title [tooling] Enforce openap scopesi generator order [tooling] Enforce openap scopes generator order Feb 11, 2026

def security_scopes(self) -> Set[Tuple[str, operations.Scope]]:
def security_scopes(self) -> List[Tuple[str, operations.Scope]]:
"""Returns a set of unique security scopes used by this API.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nb: it's still a set of scopes, just represented as a list, so I didn't changed the description, but we may want to.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are losing the deduplication in case the scope is defined multiple times, no ?
Wouldn't it be better to sort on the rendering side ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're not, the function itself is still using a set to do deduplication.

For the location of the sort, I would think it's better there, as everyone using the function is taking advantage of the sort. (But right now it's only used once)

@the-glu the-glu force-pushed the consistant_openapi_generator branch from 173d7a0 to 894d10e Compare February 11, 2026 13:46
@the-glu the-glu changed the title [tooling] Enforce openap scopes generator order [tooling] Enforce openapi scopes generator order Feb 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants