【问题标题】:How can i customize swagger-ui.html url with OpenApi如何使用 OpenApi 自定义 swagger-ui.html url
【发布时间】:2021-02-25 09:13:08
【问题描述】:

正如标题所暗示的,有没有办法改变类型的招摇网址

localhost:8080/myapp/swagger.ui.html

进入网址

localhost:8080/docs

我使用 OpenApi3,到目前为止,在文档中我不知道如何更改“swagger-ui”。感谢您提供任何可能的答案

【问题讨论】:

    标签: spring-boot swagger-ui openapi springdoc springdoc-openapi-ui


    【解决方案1】:

    application.properties 文件中使用属性springdoc.swagger-ui.path

    如果你没有上述文件,你也可以在src/main/resources文件夹下创建application.yml文件,并复制下面的YAML属性

    springdoc:
      swagger-ui:
        path: /docs
    

    【讨论】:

      猜你喜欢
      • 2017-02-19
      • 2021-06-03
      • 1970-01-01
      • 2015-02-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-07-09
      • 2018-06-08
      相关资源
      最近更新 更多