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

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

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

  1. <dependency>
  2. <groupId>org.webjars</groupId>
  3. <artifactId>swagger-ui</artifactId>
  4. <version>3.26.0</version>
  5. </dependency>
  6. <dependency>
  7. <groupId>org.apache.cxf</groupId>
  8. <artifactId>cxf-rt-rs-service-description-swagger</artifactId>
  9. <version>3.3.2</version>
  10. </dependency>
  11. @Configuration
  12. public class RestServerConfig {
  13. @Bean
  14. @Autowired
  15. public Server jaxRsServer(ApplicationContext context) {
  16. SpringJAXRSServerFactoryBean factory = RestServerFactory.withELHDefaultConfig(context);
  17. //Swagger Settings
  18. Swagger2Feature feature = new Swagger2Feature();
  19. feature.setBasePath("/");
  20. feature.setScan(true);
  21. feature.setScanAllResources(true);
  22. feature.setTitle("Rest API");
  23. feature.setVersion("3.0.0");
  24. feature.setDescription("API for ELH Rest Server");
  25. feature.setResourcePackage( "com.rest.api");
  26. factory.getFeatures().add(feature);
  27. factory.setAddress("/");
  28. return factory.create();
  29. }

暂无答案!

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

相关问题