草庐IT

java - 如何在 spring-boot 中完全禁用 swagger-ui?(/swagger-ui.html 应该返回 404)

我已阅读以下主题:DisablingSwaggerwithSpringMVC我写道:@BeanpublicDocketapi(){returnnewDocket(DocumentationType.SWAGGER_2).select().apis(RequestHandlerSelectors.basePackage("com.project.name.controller")).paths(PathSelectors.ant("/api/**")).build().apiInfo(apiInfo()).enable(false);}但如果我尝试访问swaggerui:localhos

java - 如何在 spring-boot 中完全禁用 swagger-ui?(/swagger-ui.html 应该返回 404)

我已阅读以下主题:DisablingSwaggerwithSpringMVC我写道:@BeanpublicDocketapi(){returnnewDocket(DocumentationType.SWAGGER_2).select().apis(RequestHandlerSelectors.basePackage("com.project.name.controller")).paths(PathSelectors.ant("/api/**")).build().apiInfo(apiInfo()).enable(false);}但如果我尝试访问swaggerui:localhos

java - 避免来自 swagger api 的默认基本错误 Controller

这个问题在这里已经有了答案:RemoveBasicErrorControllerInSpringFoxSwaggerUI(8个回答)关闭3年前。我在我的SpringBoot项目中使用swagger2。它运行良好,但我需要从api中排除basic-error-controller。目前我使用正则表达式使用以下代码。它正在工作,但有什么完美的方法可以做到这一点。代码:@BeanpublicDocketdemoApi(){returnnewDocket(DocumentationType.SWAGGER_2).select().apis(RequestHandlerSelectors.any

java - 避免来自 swagger api 的默认基本错误 Controller

这个问题在这里已经有了答案:RemoveBasicErrorControllerInSpringFoxSwaggerUI(8个回答)关闭3年前。我在我的SpringBoot项目中使用swagger2。它运行良好,但我需要从api中排除basic-error-controller。目前我使用正则表达式使用以下代码。它正在工作,但有什么完美的方法可以做到这一点。代码:@BeanpublicDocketdemoApi(){returnnewDocket(DocumentationType.SWAGGER_2).select().apis(RequestHandlerSelectors.any

spring - 如何为 Spring REST 服务生成 WADL

您好,我正在使用Spring3.5.0.Release。我想为我的springrest服务生成一个WADL。他们在Spring中有什么功能可以让我轻松生成WADL。 最佳答案 您可以使用Swagger-SpringMVC,它会自动将符合Swagger的API文档集成到您的应用程序中。1.0.2版本稳定,支持Swagger1.2。2.0.0版目前正在开发中,将支持Swagger2.0。api-docs可以使用http://localhost:8080/api-docs那么。https://github.com/springfox/sp

spring - 如何为 Spring REST 服务生成 WADL

您好,我正在使用Spring3.5.0.Release。我想为我的springrest服务生成一个WADL。他们在Spring中有什么功能可以让我轻松生成WADL。 最佳答案 您可以使用Swagger-SpringMVC,它会自动将符合Swagger的API文档集成到您的应用程序中。1.0.2版本稳定,支持Swagger1.2。2.0.0版目前正在开发中,将支持Swagger2.0。api-docs可以使用http://localhost:8080/api-docs那么。https://github.com/springfox/sp

java - 如何在生产中关闭 swagger-ui

我已经Swagger插入了我的SpringBoot应用程序。Springboot允许您拥有每个环境的属性文件。有没有办法在生产环境中禁用swagger? 最佳答案 将你的swagger配置放入单独的配置类并使用@Profile注释进行注释->以便仅在某些配置文件中将其扫描到Spring上下文中。例子:@Configuration@EnableSwagger2@Profile("dev")publicclassSwaggerConfig{//yourswaggerconfiguration}您可以通过命令行定义您的SpringBoot

java - 如何在生产中关闭 swagger-ui

我已经Swagger插入了我的SpringBoot应用程序。Springboot允许您拥有每个环境的属性文件。有没有办法在生产环境中禁用swagger? 最佳答案 将你的swagger配置放入单独的配置类并使用@Profile注释进行注释->以便仅在某些配置文件中将其扫描到Spring上下文中。例子:@Configuration@EnableSwagger2@Profile("dev")publicclassSwaggerConfig{//yourswaggerconfiguration}您可以通过命令行定义您的SpringBoot

java - 如何使用 Swagger 注释在 Swagger 中设置描述和示例?

我正在使用Springboot创建一个RESTApi,并使用swaggercodegen在Controller中自动生成swagger文档。但是,我无法在POST请求中为String类型的参数设置描述和示例。这是mi代码:importio.swagger.annotations.*;@Api(value="transaction",tags={"transaction"})@FunctionalInterfacepublicinterfaceITransactionsApi{@ApiOperation(value="Placesanewtransactiononthesystem.",

java - 如何使用 Swagger 注释在 Swagger 中设置描述和示例?

我正在使用Springboot创建一个RESTApi,并使用swaggercodegen在Controller中自动生成swagger文档。但是,我无法在POST请求中为String类型的参数设置描述和示例。这是mi代码:importio.swagger.annotations.*;@Api(value="transaction",tags={"transaction"})@FunctionalInterfacepublicinterfaceITransactionsApi{@ApiOperation(value="Placesanewtransactiononthesystem.",