[tooling] Enforce openapi scopes generator order#1369
Open
the-glu wants to merge 1 commit intointeruss:masterfrom
Open
[tooling] Enforce openapi scopes generator order#1369the-glu wants to merge 1 commit intointeruss:masterfrom
the-glu wants to merge 1 commit intointeruss:masterfrom
Conversation
the-glu
commented
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. |
Contributor
Author
There was a problem hiding this comment.
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.
Contributor
There was a problem hiding this comment.
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 ?
Contributor
Author
There was a problem hiding this comment.
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)
173d7a0 to
894d10e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
openapi-to-go-serverreturn 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.