RapiDoc icon indicating copy to clipboard operation
RapiDoc copied to clipboard

Feature Request: Add `sort-components`-attribute

Open Maschga opened this issue 1 year ago • 4 comments

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

Maschga avatar Nov 19 '23 16:11 Maschga

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

wparad avatar Nov 19 '23 19:11 wparad

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.

Maschga avatar Nov 19 '23 20:11 Maschga

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.

:shrug:, 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.

wparad avatar Nov 19 '23 20:11 wparad

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

Maschga avatar Nov 20 '23 06:11 Maschga