swagger-bootstrap-ui 1.7 发布了。swagger-bootstrap-ui 是 Swagger 的前端 UI 实现,目的是替换 Swagger 默认的 UI 实现 Swagger-UI,使文档更友好一点儿 swagger-bootstrap-ui 1.7更新如下: 1、分组功能实现 替换默认请求接口v2/api-docs,改为swagger的分组接口:swagger-resources,左菜单分组下拉框可选 在Spring Boot的swagger配置如: @Configuration @EnableSwagger2 public class SwaggerConfiguration { @Bean(value = "defaultApi") public Docket defaultApi() { return new Docket(DocumentationType.SWAGGER_2) .apiInfo(apiInfo()) .groupName("默认接口") .select() .apis(RequestHandlerSelectors.basePackage("com.swagger.bootstrap.ui.demo.controller")) .paths(PathSelectors.any()) .build(); } @Bean(value = "groupRestApi") public Docket groupRestApi() { return new Docket(DocumentationType.SWAGGER_2) .apiInfo(groupApiInfo()) .groupName("分组接口") .select() .apis(RequestHandlerSelectors.basePackage("com.swagger.bootstrap.ui.demo.group")) .paths(PathSelectors.any()) .build(); } private ApiInfo groupApiInfo(){ return new ApiInfoBuilder() .title("分组Api") .description("swagger-bootstrap-ui-demo RESTful APIs") .termsOfServiceUrl("http://www.group.com/") .contact("group@qq.com") .version("1.0") .build(); } private ApiInfo apiInfo() { return new ApiInfoBuilder() .title("swagger-bootstrap-ui-demo RESTful APIs") .description("swagger-bootstrap-ui-demo RESTful APIs") .termsOfServiceUrl("http://www.xx.com/") .contact("xx@qq.com") .version("1.0") .build(); } } 详细示例参考demo:swagger-bootstrap-ui-demo 2、文件上传,form表单action地址取相对路径,截取掉首字符"/" Maven坐标 <dependency> <groupId>com.github.xiaoymin</groupId> <artifactId>swagger-bootstrap-ui</artifactId> <version>1.7</version> </dependency> |