美文网首页
Swagger和OpenAPI

Swagger和OpenAPI

作者: 暗夜行者 | 来源:发表于2020-09-25 16:35 被阅读0次

OpenAPI Specification (formerly Swagger Specification) is an API description format for REST APIs. An OpenAPI file allows you to describe your entire API.

wagger is a set of open-source tools built around the OpenAPI Specification that can help you design, build, document and consume REST APIs.

来源: https://swagger.io/docs/specification/about/

OpenAPI同样提供swagger的浏览方式,且在spring boot项目中集成简单到哭,只在pom文件中加入:

  <dependency>

        <groupId>org.springdoc</groupId>

       <artifactId>springdoc-openapi-ui</artifactId>

       <version>1.2.32</version>

</dependency>
在配置文件中配置好访问路径,启动即可。与之对应,swagger要配置很多东西,且版本不断更新,新版和旧版切换有调试成本。

openAPI 3.0集成: https://www.baeldung.com/spring-rest-openapi-documentation

swagger 2.9.2 版本集成: https://www.baeldung.com/swagger-2-documentation-for-spring-rest-api

相关文章

网友评论

      本文标题:Swagger和OpenAPI

      本文链接:https://www.haomeiwen.com/subject/iypfuktx.html