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

Feature Request: Add sort-components-attribute #977

Open
Maschga opened this issue Nov 19, 2023 · 4 comments
Open

Feature Request: Add sort-components-attribute #977

Maschga opened this issue Nov 19, 2023 · 4 comments

Comments

@Maschga
Copy link

Maschga commented Nov 19, 2023

Hi,
I use RapiDocs in render-style="focused" and I have activated show-components.

To sort items like requests or tags, there are the attributes sort-tags and sort-endpoints-by. However, there is no attribute that sorts components/schemas alphabetically.
This would be a great help for the user if a documentation uses several components - in my case there are 60 randomly arranged ones.

Is it possible to add an attribute like sort-components?

Many thanks in advance!
Maschga

@wparad
Copy link

wparad commented Nov 19, 2023

Why not presort the tags and schemas in your spec, then doesn't it come out by default exactly as you have it?

@Maschga
Copy link
Author

Maschga commented Nov 19, 2023

Hi,
That would be possible but with 60 components it is a lot of manual effort to sort them. In addition, the question then arises as to why this feature should exist for tags and endpoints. After all, these can also be sorted manually.

@wparad
Copy link

wparad commented Nov 19, 2023

Hi, That would be possible but with 60 components it is a lot of manual effort to sort them. In addition, the question then arises as to why this feature should exist for tags and endpoints. After all, these can also be sorted manually.

🤷, I don't honestly know, realistically there are so many different ways things can be sorted that it can be often a mistake to attempt to sort them.

I will say that we run a fork and we do automatically sort schema for components alphabetically. I guess we decided here, there is only one correct sort order.

@Maschga
Copy link
Author

Maschga commented Nov 20, 2023

Alphabetical sorting will be used by the majority of users. The developers of Rapidoc will also have had this in mind for the "sort-tags" attribute:

To list tags in alphabetic order, otherwise tags will be ordered based on how it is specified under the tags section in the in the spec.

Link

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

No branches or pull requests

2 participants