May*_*yur 3 java spring spring-mvc spring-boot springfox
我有一个正在使用Springfox生成API文档的项目。
我想在编译时生成swagger.json 。
以下是示例springfox配置,
@Configuration
@EnableSwagger2
public class SwaggerConfig {
@Bean
public Docket productApi() {
return new Docket(DocumentationType.SWAGGER_2)
.select()
.apis(RequestHandlerSelectors.basePackage("com.abc.xyz"))
.paths(regex("/*.*"))
.build();
}
}
Run Code Online (Sandbox Code Playgroud)
仅供参考:我也尝试过https://github.com/kongchen/swagger-maven-plugin插件,但是它不起作用
归档时间: |
|
查看次数: |
2344 次 |
最近记录: |