Improce doc sort order#1054
Conversation
|
@chaikivskyi aren't endpoints sorted based on their definition order by default? |
|
@romalytvynenko No, on my project, the first endpoint displayed comes from line 47 of one of the route files. |
|
@romalytvynenko There is one more issue related to the sort order. We currently do not create root tags for paths that don’t have the I suggest also creating root tags for all routes in the documentation, even when the #[Group] attribute is missing. Please let me know if this approach makes sense to you. |
|
Hi @romalytvynenko , any update? |
|
@chaikivskyi I need a bit more time to review, but I definitely plan to merge it. |
This reverts commit 5983d68.
|
@chaikivskyi I merged but then noticed that indeed, Scramble used to sort groups (that have names) based on their definition order by default. So I reverted it as I believe that definition order allows users to manually sort endpoints groups by some logic just by moving definitions. I understand your case but I'd rather go with additional configuration option, then changing this default. Here is a screenshot from my demo project where you can see that groups are ordered in the order they are defined in
|


Problem
When a group does not have a weight defined, the sorting order becomes unpredictable.
As a result, the API documentation appears cluttered and difficult to navigate.
Solution
Introduce a secondary sorting rule:
Primary: sort by weight (when defined)
Fallback: sort by group name when weight is not set
Result
This change ensures a consistent and predictable order in the API documentation, making it cleaner, more readable, and significantly easier to find the required groups.