【问题标题】:Turn off open API specification in production environment在生产环境中关闭开放 API 规范
【发布时间】:2021-02-17 21:54:22
【问题描述】:

我在这里看到Swagger 2.x 的类似答案 - How do you turn off swagger-ui in production 所以我想知道我是否也可以为开放 API 做类似的事情?我试过类似的东西:

@Configuration
@Profile("!prod")
public class OpenAPIConfig 
{
}

但这不起作用。有什么想法/建议吗?

【问题讨论】:

    标签: java spring spring-boot openapi


    【解决方案1】:

    也许您可以在 prod yaml 中设置以下属性,

    springdoc.api-docs.enabled=false
    

    【讨论】:

      猜你喜欢
      • 2011-09-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-10-19
      • 1970-01-01
      • 2018-06-04
      • 1970-01-01
      • 2012-05-21
      相关资源
      最近更新 更多