apchecxf for jax rs diable支持的提交方法(try it out按钮)

ndh0cuux  于 2021-07-05  发布在  Java
关注(0)|答案(0)|浏览(206)

我在jax-rs服务点应用程序中找不到禁用swagger try-it-out按钮的方法可以通过springfox禁用它,但在使用springfox时我无法使swagger运行
这是密码

<dependency>
  <groupId>org.webjars</groupId>
  <artifactId>swagger-ui</artifactId>
  <version>3.26.0</version>
</dependency>
<dependency>
  <groupId>org.apache.cxf</groupId>
  <artifactId>cxf-rt-rs-service-description-swagger</artifactId>
  <version>3.3.2</version>
</dependency>

@Configuration
public class RestServerConfig {
    @Bean
        @Autowired
        public Server jaxRsServer(ApplicationContext context) {
            SpringJAXRSServerFactoryBean factory = RestServerFactory.withELHDefaultConfig(context);

            //Swagger Settings
            Swagger2Feature feature = new Swagger2Feature();
            feature.setBasePath("/");
            feature.setScan(true);
            feature.setScanAllResources(true);
            feature.setTitle("Rest API");
            feature.setVersion("3.0.0");
            feature.setDescription("API for ELH Rest Server");
            feature.setResourcePackage( "com.rest.api");

            factory.getFeatures().add(feature);
            factory.setAddress("/");
            return factory.create();
        }

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题