The OpenAPI Specification (formerly named Swagger) is an API description format for REST APIs. An API specification written using the the rules set by the Open API Initiative can be used to describe:
- All the available endpoints. An endpoint is a unique resource that can access or modify a given object.
- Input parameters, such as headers, query parameters and/or body parameters.
- The structure of the response, including headers status codes and the body - if any.
- Authentication methods
- Contact information, license, terms of use and other information
This post look into how to write an API specification and how to use it together with Mojolicious::Plugin::OpenAPI and OpenAPI::Client.