OpenAPI Specification explained

OpenAPI
Long Name:OpenAPI Specification
Version:3.1.0

The OpenAPI Specification, previously known as the Swagger Specification, is a specification for a machine-readable interface definition language for describing, producing, consuming and visualizing web services.[1] Previously part of the Swagger framework, it became a separate project in 2015, overseen by the OpenAPI Initiative, an open-source collaboration project of the Linux Foundation.[2]

An OpenAPI document represents a formal description of an API that tools can use to generate code, documentation, test cases, and more.

History

Swagger development began in early 2010 by Tony Tam, who was working at online dictionary company Wordnik.[3]

In March 2015, SmartBear Software acquired the open-source Swagger API specification from Reverb Technologies, Wordnik's parent company.[4]

In November 2015, SmartBear announced that it was donating the Swagger specification to a new organization called the OpenAPI Initiative, under the sponsorship of the Linux Foundation. Other founding member companies included 3scale, Apigee, Capital One, Google, IBM, Intuit, Microsoft, PayPal, and Restlet.[5] [6]

On 1 January 2016, the Swagger specification was renamed the OpenAPI Specification (OAS) and was moved to a new GitHub repository.[7]

In July 2017, the OpenAPI Initiative released version 3.0.0 of its specification.[8] MuleSoft, the main contributor to the alternative RESTful API Modeling Language (RAML), joined the OAS and open-sourced its API Modeling Framework tool, which can generate OAS documents from RAML input.[9]

In February 2021, the OpenAPI Initiative released version 3.1.0.[10] Major changes in OpenAPI Specification 3.1.0 include JSON schema vocabularies alignment, new top-level elements for describing webhooks that are registered and managed out of band, support for identifying API licenses using the standard SPDX identifier, allowance of descriptions alongside the use of schema references and a change to make the PathItems object optional to simplify creation of reusable libraries of components.[11] [12] [13]

Release dates

Version Date Notes[14]
3.1.0 2021-02-15 Release of the OpenAPI Specification 3.1.0
3.0.32020-02-20Patch release of the OpenAPI Specification 3.0.3
3.0.22018-10-08Patch release of the OpenAPI Specification 3.0.2
3.0.12017-12-06Patch release of the OpenAPI Specification 3.0.1
3.0.0 2017-07-26 Release of the OpenAPI Specification 3.0.0
2.0 2014-09-08 Release of Swagger 2.0
1.2 2014-03-14 Initial release of the formal document
1.1 2012-08-22 Release of Swagger 1.1
1.0 2011-08-10 First release of the Swagger Specification

Usage

Applications implemented based on OpenAPI interface files can automatically generate documentation of methods, parameters and data models. This helps keep the documentation, client libraries and source code in sync.[15]

When an OpenAPI document is used to generate source code stubs for servers, the process is called scaffolding.

Relationships to software engineering practices

The paradigm of agreeing on an API contract first and then programming business logic afterwards, in contrast to coding the program first and then writing a retrospective description of its behavior as the contract, is called contract-first development. Since the interface is determined before any code is written, downstream developers can mock the server behavior and start testing right away.[16] In this sense, contract-first development is also a practice of shift-left testing.

Features

The OpenAPI Specification is language-agnostic. With OpenAPI's declarative resource specification, clients can understand and consume services without knowledge of server implementation or access to the server code.

Tools that work with OpenAPI

The OpenAPI Initiative maintains a list of implementations for version 3.0 of the specification. SmartBear still brands its OpenAPI tools with the Swagger moniker. The Swagger UI framework allows both developers and non-developers to interact with the API in a sandbox UI that gives insight into how the API responds to parameters and options. Swagger can handle both JSON and XML.

Swagger Codegen contains a template-driven engine to generate documentation, API clients and server stubs in different languages by parsing the OpenAPI definition. In July, 2018, William Cheng, the top contributor to Swagger Codegen, and over 40 other contributors to Swagger Codegen forked the code into a project named OpenAPI Generator under the OpenAPI Tools organization.[17] [18]

Annual conference

The OpenAPI Initiative sponsors an annual API Specifications Conference (ASC). The event has its origins in the API Strategy and Practice Conference (APIStrat) that ran for many years and became part of the OpenAPI Initiative in 2016.

See also

Bibliography

External links

Notes and References

  1. Web site: New Collaborative Project to Extend Swagger Specification for Building Connected Applications and Services. https://web.archive.org/web/20231031170437/https://www.linuxfoundation.org/press/press-release/new-collaborative-project-to-extend-swagger-specification-for-building-connected-applications-and-services. 31 October 2023.
  2. Web site: OpenAPI Initiative Charter . OpenAPI Initiative . 12 November 2019.
  3. Web site: Swagger creator joins SmartBear. August 6, 2019.
  4. Web site: SmartBear Assumes Sponsorship of Swagger API Open Source Project. SmartBear. 2015-03-25.
  5. Web site: FAQ . OpenAPI Initiative . 12 November 2019.
  6. Web site: New Collaborative Project to Extend Swagger Specification for Building Connected Applications and Services. linuxfoundation.org. 2016-04-22. dead. https://web.archive.org/web/20160427104213/http://www.linuxfoundation.org/news-media/announcements/2015/11/new-collaborative-project-extend-swagger-specification-building. 2016-04-27.
  7. Web site: OpenAPI Initiative . OpenAPI Specification . GitHub . 12 November 2019.
  8. Web site: The OAI Announces the OpenAPI Specification 3.0.0. July 26, 2017 . OpenAPIs. 2018-04-19.
  9. Web site: The HTTP API space is Consolidating around OAS. Abel . Avram . May 6, 2017 . InfoQ. 2017-05-14.
  10. Web site: OpenAPI Specification 3.1.0 Available Now. April 26, 2021 . Linux.com. 2021-04-26.
  11. Web site: What's New in OpenAPI 3.1.0?. Tyler . Charboneau . April 7, 2021 . Nordic APIs. 2021-04-07.
  12. Web site: OpenAPI Specification 3.1.0 Released. February 18, 2021 . OpenAPI Initiative. 2021-02-18.
  13. Web site: Migrating from OpenAPI 3.0 to 3.1.0. Phil . Sturgeon . February 16, 2021 . OpenAPI Initiative. 2021-02-16.
  14. Web site: OpenAPI Specification Version 3.1.0. GitHub . November 7, 2023.
  15. Web site: swagger-api/swagger-spec. GitHub. 2015-12-01 . deviated . https://archive.today/20160604140815/https://github.com/OAI/OpenAPI-Specification/wiki . 4 Jun 2016 .
  16. Book: Preibisch, Sascha . API Development: A Practical Guide for Business Implementation Success . Apress . 2018 . 978-1-4842-4140-0 . [Berkeley, CA] . 1076234393 . Having the Swagger (or for that matter, any other machine-readable) document available, team members can start working on their part of the project at the same time..
  17. News: Swagger Codegen is now OpenAPI Generator. Johannes . Hoppe . 2018 . Angular.Schule . August 6, 2019.
  18. News: Swagger Codegen Fork: Q&A. OpenAPI Generator . August 6, 2019.