Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: better path sorting for openapi UIs #6583

Merged
merged 6 commits into from
Sep 7, 2024

Conversation

mrossard
Copy link
Contributor

@mrossard mrossard commented Sep 5, 2024

Q A
Branch? 3.4
License MIT

I've noticed for a while that operations sorting as displayed by tools like swagger-ui or scalar could be confusing at first - they are sorted by path, but displayed by tags first.

This PR sorts them by tags, then by path. As a very small optimization (assuming there are more writes than reads) it also triggers the sorting only when the paths are actually used instead of sorting each time a new path is added.

@mrossard
Copy link
Contributor Author

mrossard commented Sep 5, 2024

This probably should target 3.3, used 3.4 without thinking...sorry.

src/OpenApi/Model/Paths.php Outdated Show resolved Hide resolved
@mrossard mrossard requested a review from soyuka September 5, 2024 11:17
@soyuka soyuka merged commit 130fb5a into api-platform:3.4 Sep 7, 2024
78 checks passed
@soyuka
Copy link
Member

soyuka commented Sep 7, 2024

Thanks!

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