当我在 swagger 中执行我的 spring 应用程序时,默认协议是 http,我想在 https 中执行它,因为应用程序在 HTTPS 中运行。我该如何配置?
这是我的代码:
@Configuration
@EnableSwagger2
public class SwaggerConfig{
@Bean
public Docket api() {
return new Docket(DocumentationType.SWAGGER_2)
.apiInfo(metaData())
.select()
.apis(RequestHandlerSelectors.basePackage("com.adp.mnc.metadata.controller"))
.paths(PathSelectors.any())
.build();
}
答案 0 :(得分:0)
您可以使用.protocols(Sets.newHashSet("http", "https"))