OpenAPI description
Overview
OpenAPI is a specification for describing REST API interfaces. The OpenAPI Specification (OAS) is both human and machine-readable.
The OpenAPI Description (OAD) represents a formal description of an API and is often published by a service provider as a JSON or YAML file. The description can be used to generate client libraries, documentation, and other tools.
See OpenAPI Specification v3.1.0 and OpenAPI Initiative for more information.
Yoco’s OpenAPI description
A publicly accessible OpenAPI 3.1 description of the REST API is available at https://api.yoco.com/openapi.json.
Using the OpenAPI description
Because the OpenAPI description is machine-readable, there are many publicly available tools that can be used to generate client libraries, documentation, and test API integrations.
Here are some common use-cases:
- Generate client libraries using OpenAPI Generator
- Generate documentation using Swagger UI
- Mock an API using Prism
- Import OpenAPI definition into Postman and Bruno.
Generating an API client using OpenAPI Generator
OpenAPI Generator is recommended for generating client libraries.
Generating a Python API client using openapi-python-client
openapi-python-client is recommended for generating a client library for Python. It is a more modern alternative that has strong typing, better support for async and leverages Pydantic for data models and validation.