Swagger UI - How can I expand all the operations by default?
I believe you can set the docExpansion:"full"
when creating swagger-ui.
See https://github.com/swagger-api/swagger-ui#parameters for details.
docExpansion: Controls the default expansion setting for the operations and tags. It can be 'list' (expands only the tags), 'full' (expands the tags and operations) or 'none' (expands nothing). The default is 'list'.
I just found out I actually can pass the parameter to the swagger url like so:
http://...../swagger/index.html?docExpansion=none
docExpansion : "none" - hide everything.
docExpansion : "list"- expand/List all the operations only.
docExpansion : "full" - expand everything (full expand as the name says).
Here is the answer with Springfox which is what you seem to use :
@Bean
UiConfiguration uiConfig() {
return UiConfigurationBuilder.builder()
.docExpansion(DocExpansion.LIST) // or DocExpansion.NONE or DocExpansion.FULL
.build();
}
source : http://springfox.github.io/springfox/docs/current/#springfox-swagger2-with-spring-mvc-and-spring-boot