我试图在spring-cloud-config应用程序(spring boot-2.5.0(中启用Swagger 2.0,我在主类中放入了@EnableConfigServer注释。
但是swagger不起作用,当我在这种情况下删除这个注释时,swagger正常工作,但属性文件不是来自微服务中的GitHub repo
使用
spring.cloud.config.server.prefix= /cloud
应用程序属性中的此行用于配置云配置服务器路径。并允许像那样的地址
@Override
public void configure(WebSecurity web) throws Exception {
web.ignoring()
.antMatchers("/cloud/**")
.and()
.httpFirewall(allowUrlEncodedSlashHttpFirewall());
}
你的云地址将像一样
spring.config.import=optional:configserver:******/cloud