官术网_书友最值得收藏!

The OpenAPI Specification

As the name suggests, the OpenAPI Specification (OAS) is driven by an open source community that's focused on the OpenAPI Initiative within the Linux Foundation Collaborative Project.

In a few words, the OpenAPI Specification is a language-agnostic interface that was designed for REST APIs and allows consumers to discover the capabilities of a service without even knowing what code base is being used to implement the API. The API may not even be ready to use or have a single line of code written. The main reason for this is mentioned in the documentation provided by OpenAPI. Once you have an OpenAPI Specification for your API, it is easy to add the Swagger UI to the project as an interactive communication tool.

Swagger is a project that's composed of tools that help the developers of REST APIs in tasks such as the following:

  • API modeling
  • Generating API documentation (readable)
  • Generating client and server code, with support for various programming languages

In addition to OpenAPI, Swagger provides an ecosystem of tools to help developers when they're designing a new API or maintaining an existing one . Some of these tools are as follows:

  • Swagger Editor—for creating a contract:
  • Swagger UI—for publishing documentation:
  • Swagger Codegen—for generating the skeletons of servers:

In a few words, OpenAPI describes APIs that could be represented in either YAML or JSON formats.

At the time of writing this book, OpenAPI is on Version 3. It is versioned using Semantic Versioning 2.0.0 (semver) and follows the semver specification.

The following sections will walk you through how to get started with OpenAPI with Swagger.

It is strongly recommended that you take a look at the OpenAPI Specification itself, which is available at https://www.openapis.org/, as well as the Swagger specification, which is available at https://Swagger.io/specification, to learn more.
主站蜘蛛池模板: 淳化县| 文成县| 建平县| 辽阳县| 巩留县| 濮阳县| 金坛市| 汉中市| 兴业县| 化德县| 民和| 封开县| 伊川县| 牙克石市| 泸溪县| 静宁县| 云和县| 新邵县| 宜宾县| 水富县| 儋州市| 安康市| 泸水县| 分宜县| 定安县| 普洱| 土默特左旗| 蓬溪县| 调兵山市| 安新县| 长宁县| 城口县| 遵义县| 太和县| 鲁甸县| 同江市| 天全县| 苏尼特右旗| 卫辉市| 鞍山市| 嵊泗县|