您的位置 首页 java

springdoc-openapi:帮助spring-boot自动生成API的开源库工具

Spring doc- Open api Java 库帮助你的Spring Boot项目自动生成API文档。

springdoc- OpenAPI 通过在运行时检查应用程序来根据 Spring 配置、类结构和各种注释推断 API 语义。

该库自动生成 JSON / yaml 和 HTML 格式页面的文档。生成的文档可以使用swagger-api注释进行补充。

该库支持:

  • OpenAPI 3
  • Spring-boot (v1 and v2)
  • JSR-303, specifically for @NotNull, @Min, @Max, and @Size.
  • Swagger-ui
  • Oauth 2

特点:

  • 自动将 swagger-ui 部署到 Spring Boot 2.x 应用程序
  • 文档将以 HTML 格式提供,使用官方 swagger-ui jars 。
  • Swagger UI 页面应在 可用,OpenAPI 描述将在以下 json 格式的 url 可用: -path/v3/api-docsserver:服务器名称或IPport: 服务器端口 context-path:应用程序的上下文路径
  • 文档也可以以 yaml 格式提供,位于以下路径:/v3/api-docs.yaml
  • 将springdoc-openapi-ui库添加到项目依赖项列表中(无需额外配置):
    <dependency>
      <groupId>org.springdoc</groupId>
      <artifactId>springdoc-openapi-ui</artifactId>
      <version>last-release-version</version>
   </dependency>  

文章来源:智云一二三科技

文章标题:springdoc-openapi:帮助spring-boot自动生成API的开源库工具

文章地址:https://www.zhihuclub.com/188898.shtml

关于作者: 智云科技

热门文章

网站地图