I'm using Swagger API documentation for my rest services. I have successfully integrated Swagger with my code and it works.
But I have a requirement to format the Swagger UI. Since the number of response classes are many in my project, the Swagger page looks very lengthy and the user has to scroll down a lot to view information.
So I want to collapse my response model classes and expand it when the user clicks the class. Is there a way to do it and if so where and what changes have to be made. I tried editing the Swagger-UI.js file but I could not achieve the needed output.
Please let me know and thanks in advance.
swagger-ui has the parameter docExpansion (see https://github.com/swagger-api/swagger-ui#parameters). Default is list
, but if set it to none
in the defaults section in src/core/index.js
:
docExpansion: "none"
it will work and collapse everything when loading the site.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With