-
Notifications
You must be signed in to change notification settings - Fork 66
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
Configurable collapse mode for swagger UI #165
Comments
Thank you for your suggestion. At this time the plugin does not support Swagger UI options. You can replace the default This is because Swagger UI has many options and I don't want to maintain the options. |
just a thought but if this option is a default option present in the json object we should be able to interact with me as i found that i would like it collapsed as well. just a thought. i would not mind trying to contribute this feature. |
Describe the feature
Introduce new configuration option to choose collapse mode of generated swagger UI documentation.
The template of swagger UI itself allows easily to define default collapsing behavior over "docExpansion" property in SwaggerUIBundle definition.
See:
gradle-swagger-generator-plugin/src/main/resources/swagger-ui.html
Line 78 in 0857fe8
Swagger UI documentation defines "docExpansion" with three available modes "none", "list", "full". All three defines default view on page load and all make sense for different use-cases.
See https://github.com/swagger-api/swagger-ui/blob/master/docs/usage/configuration.md#display
Currently, only fixed value with "full" value is possible to be generated using gradle-swagger-generator-plugin.
Why do you want the feature?
It would be really useful to have this option, because there are some use-cases especially for larger projects (with several tags defined) where default behavior of everything expanded is super-annoying for readers. It all the time leads for reader to manually collapse all UI elements and then start using the documentation.
Anyone who wants to workaround this issue can do same trick as me: generate HTML documentation using gradle plugin and then post-process the output by another script. The script does an easy work, replace "docExpansion" value with the one you need in a file index.html. The workaround is a bit fragile and hacky, but works up to this point.
The text was updated successfully, but these errors were encountered: