美文网首页
swagger根据代码生成yml

swagger根据代码生成yml

作者: 刘书生 | 来源:发表于2019-03-29 18:00 被阅读0次
 <plugin>
                <groupId>com.github.kongchen</groupId>
                <artifactId>swagger-maven-plugin</artifactId>
                <version>3.1.7</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <apiSources>
                        <apiSource>
                            <locations>cn.wgd.zmx.controller</locations>      //你要生成api的路径
                            <info>
                                <title>志愿填报API</title>
                                <version>0.0.1-SNAPSHOT</version>
                            </info>
                            <schemes>http</schemes>
                            <host>localhost</host>
                            <outputFormats>yaml</outputFormats>
                            <swaggerApiReader>com.github.kongchen.swagger.docgen.reader.SpringMvcApiReader
                            </swaggerApiReader>
                            <swaggerDirectory>${basedir}/target/swagger</swaggerDirectory>    //生成后存放的位置
                        </apiSource>
                    </apiSources>
                </configuration>
            </plugin>

相关文章

网友评论

      本文标题:swagger根据代码生成yml

      本文链接:https://www.haomeiwen.com/subject/eajrbqtx.html