Generate API Models from Traffic

The apispec command transforms traces into OpenAPI3 specifications annotated with additional information, like data formats.

# Creating a spec from a trace in the Akita Cloud:
akita apispec --traces akita://myService:trace:traceName \
  --out akita://myService:spec:specName

# Creating a spec from a trace stored in the local file system:
akita apispec --service myService --traces path/to/traceName.har \
  --out path/to/specTarget.yaml

Specs created in the Akita Cloud will be located in the service specified in the AkitaURI. For specs output locally, a copy will also be created in the service given in the --service flag.

--traces

Use the --traces flag to choose one or more traces to build a spec from. Each argument is either a path to a trace file in the local file system or an AkitaURI referencing a trace located in the Akita Cloud.

--out

The --out flag identifies the target location to create the spec and can be a local file path or an AkitaURI.

The special value --out - prints the spec to stdout.

By default, if --out is not present, then the spec will be assigned an auto-generated name and stored in the Akita Cloud in the service supplied in the --service flag. In this case, the --service flag is required.

More Info

Take a look here for details of the apispec command, including optional arguments and more examples.


Did this page help you?