这里写自定义目录标题
Swagger接口文档加强
Swagger原生的ui界面不太美观,所以采用了开源加强版,springboot2.x示例
1.配置pom.xml
<properties>
<springfox-swagger2.version>2.9.2</springfox-swagger2.version>
<swagger-bootstrap-ui.version>1.9.0</swagger-bootstrap-ui.version>
</properties>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>${springfox-swagger2.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.github.xiaoymin</groupId>
<artifactId>swagger-bootstrap-ui</artifactId>
<version>${swagger-bootstrap-ui.version}</version>
</dependency>
2.启动类加注解
@EnableSwagger2
@EnableSwaggerBootstrapUI
3.浏览器访问如图
http://localhost:8080/doc.html