swagger文档在开发时是一个很大的助力,但是在对外提供接口文档时就不是很灵活。
这里记录一下从swagger文档转html的方法(还能转pdf,暂时用不上)。
先建立一个空的maven项目,在pom中添加
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<file_encoding>UTF-8</file_encoding>
</properties>
<build>
<plugins>
<plugin>
<groupId>io.github.swagger2markup</groupId>
<artifactId>swagger2markup-maven-plugin</artifactId>
<version>1.3.7</version>
<configuration>
<!--此处填要生成文档的swagger2 json api地址-->
<swaggerInput>http://localhost:8081/v2/api-docs?group=0.1%E7%89%88</swaggerInput