@Bean
public Docket categoryApi() {
return new Docket(DocumentationType.SWAGGER_2)
.host("twogoods.cc")
.groupName("bookplatform-api")
.apiInfo(apiInfo())
.select()
.paths(apiPaths())
.build()
.directModelSubstitute(java.sql.Timestamp.class, java.sql.Date.class)
.enableUrlTemplating(false);
}
host()
method!!!
host(..)
和 protocols(..)
方法,来覆盖默认值。
@Bean
public Docket customImplementation() {
return new Docket(DocumentationType.SWAGGER_2)
.protocols(Collections.singleton("https"))
.host("twogoods.cc")
.select()
.build();
}