问题
@Tag和@Operation标签失效
但是@Schema标签有效
pom依赖
-
-
- <dependency>
- <groupId>org.springdocgroupId>
- <artifactId>springdoc-openapi-starter-webmvc-uiartifactId>
- <version>2.2.0version>
- dependency>
debug排查,发现时国际化问题
解决方法:application.yml配置禁用i18n翻译
- springdoc:
- # 若开启,不使用国际化,可能会导致无法获得@tag和@operation标签的内容
- disable-i18n: true
- api-docs:
- # 是否开启接口文档
- enabled: true
- swagger-ui:
- # 持久化认证数据,如果设置为 true,它会保留授权数据并且不会在浏览器关闭/刷新时丢失
- persistAuthorization: true
- # remove-broken-reference-definitions: false
- #默认地址是,可导入apifox http://localhost:8080/v3/api-docs
- #默认ui地址是 http://localhost:8080/swagger-ui/index.html