<a href="https://swagger.io/specification/" target="_blank">OpenAPI Specification</a> (OAS) is an API description format for REST APIs. Circle’s OpenAPI 3.0 files empower you to view our APIs with your preferred tool, generate code, create mock servers and generate Postman collections. Don’t forget we offer a pre-packaged [Postman](🔗) option too!
# OpenAPI Files
OpenAPI files can be acquired through Github within our OpenAPI repository. Each file matches one to one with the products we offer.
# Personal Viewers
Whatever the reason may be, if you prefer your own API viewer over the provided API References you can use Circle’s <a href="https://github.com/circlefin/openapi" target="_blank">OpenAPI</a> files to view them in your tool of choice.
Here are some great viewers that we like:
<a href="https://editor.swagger.io" target="_blank">Swagger Editor/Viewer</a>
<a href="https://swagger.io/tools/swaggerhub/" target="_blank">Swagger Hub</a> (Requires an account)
Visual Studio Code: <a href="https://marketplace.visualstudio.com/items?itemName=42Crunch.vscode-openapi" target="_blank">OpenAPI (Swagger) Editor</a> by 42Crunch or <a href="https://marketplace.visualstudio.com/items?itemName=Arjun.swagger-viewer" target="_blank">Swagger Viewer</a> by Arjun G
# Generate Code
With <a href="https://github.com/circlefin/openapi" target="_blank">Circle’s OpenAPI files</a>, it is now possible to auto-generate Circle client code in your programming language. This can be achieved by combining Circle’s OpenAPI with open source tools such as <a href="https://openapi-generator.tech/" target="_blank">OpenAPI Generator</a>.
# Mock Server
With Circle’s OpenAPI, you can now run a mock server of Circle’s APIs locally and in your CI environments. Using a mock server can reduce time spent during development and testing.
A mock API server allows you to emulate a real API (such as Circle) locally, in your test environments, and/or publicly. This mock server can receive requests, and will respond to them with static or dynamic data that simulates what the real API would return.
## Getting started
In order to generate a mock server from Circle’s OpenAPI specification, you will use the open source tool, <a href="https://github.com/stoplightio/prism" target="_blank">Prism</a>. In the words of Prism: _"Prism is an open-source HTTP mock server that can mimic your API’s behavior as if you already built it. Mock HTTP servers are generated from your OpenAPI v2/v3 (formerly known as Swagger) documents"_. - Prism
To Install Prism run one of the two following commands:
Next, feed a specification file to Prism so that it can generate the desired mock API server.
If all things work as expected you will see a trace ending with the word start in green. Now you can send requests via cURL or Postman to the destination Prism is listening on.