Spring Boot 3 集成 Swagger UI

Java 17 Spring Boot 3.5.5 Springdoc OpenAPI 2.8.13 Maven 依赖 xml 1 2 3 4 5 <dependency> <groupId>org.springdoc</groupId> <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId> <version>2.8.13</version> </dependency> 请注意与 Spring Boot 版本的兼容,兼容矩阵可查看 FAQ 相关配置 OpenAPI doc 详细配置项可参考 官方文档 默认路径: text 1 http://localhost:8080/v3/api-docs 我们可以通过配置 springdoc.api-docs.path 来自定义 OpenAPI doc 的路径。 例如: properties 1 2 # 当我们如下配置时,OpenAPI doc 的路径为: http://localhost:808/api-docs springdoc.api-docs.path=/api-docs 默认情况下,OpenAPI doc 为 JSON 格式,我们可以通过如下配置修改为 yaml: properties 1 springdoc.api-docs.path=/api-docs.yaml Swagger UI 详细配置项可参考 官方文档 默认路径: text 1 http://localhost:8080/swagger-ui/index.html 我们可以通过配置 springdoc....

 ·  ·