Now we're going to show you how to automatically generate an OpenAPI 3 specification on the client side, for any AJAX website (or really, any service you can generate HAR files for.) You can then use the API for documentation, diffs, and more.
Akita is currently in private beta. If you are not part of the private beta, you will need to request an invite before continuing. Get an invite.
You'll need the following things in order to follow along with this tutorial:
- Akita Client - If you don't already have the Akita Client installed, follow this guide to get set up.
- API Service - You will need a service that provides an HTTP API that you can access either through a browser or a proxy (for instance, Charles).
Now we'll show you how to use Akita to:
To build API models from traffic, you first need to create a ‘Service’ to associate the model with.
You can name your new service whatever you like, but it will be easier to find it again later if the name reflects the name of the API whose model you're learning.
The next step collect API traffic using a proxy. We have instructions using both mitmdump and
Step 1: Follow the instructions for using Akita with a proxy to generate a HAR file.
You can use the apispec command to transform a trace (the HAR file) into an API model.
akita apispec --traces path/to/yourTraceFile.har \ --out akita://myService:spec:mySpec
This will read the HAR file from your file system (use the location where you saved the HAR file instead of
path/to/yourTraceFile.har) and create a model in the Akita Cloud. Use your service name instead of
myService in the AkitaURI, and pick a name for the model.
Here you'll see stats about your spec, like the number of requests in the trace that went into making the spec, the total number of endpoints Akita discovered (after grouping requests by path parameter), and any sensitive data formats detected. Click on any of the endpoints to see more information.
Finally, there's also a handy button to download a YAML representation of your spec, which you can use anywhere OpenAPI3 specs are used. Akita will also use this model for generating diffs.
Updated 25 days ago