swagger-ui icon indicating copy to clipboard operation
swagger-ui copied to clipboard

Add collapsible feature for curl display in SwaggerUI

Open jagerzhang opened this issue 2 years ago • 1 comments

Currently, SwaggerUI provides a curl syntax display for API requests making it easy for users to copy and run the request from the UI. However, for requests with a large number of parameters, the curl syntax can be quite long and difficult to read.

To improve usability, I propose adding a collapsible feature for the curl display in SwaggerUI. This would allow users to easily fold and expand the sections of the curl syntax they are interested in, making it easier to read and work with.

Overall, I believe that this feature would enhance the user experience of SwaggerUI and make it even more user-friendly for those working with complex API requests.

In previous versions, content was automatically folded, while in the newer version, it is expanded. It would be great to have a button that allows users to quickly switch between the two, to avoid excessively long pages caused by too much expanded content.

previous versions(v2.x): image

latest version(v5.0): image

Can we have an option to toggle automatic folding with a button or configure it as per our preferences?

jagerzhang avatar Jun 18 '23 02:06 jagerzhang

I worked on this issue but failed to locate openapi.json among all the Sagger-ui folders to complete it, Anyone to help please if possibe.

Mathias02 avatar Mar 30 '25 12:03 Mathias02