Skip to main content

Track changes with OpenAPI

A ridiculously easy approach to documenting your APIs and keep the specification up-to-date. Adopt OpenAPI without investing lots of time and changing how you work.

How Optic helps you adopt OpenAPI

Imagine Git, but for tracking your API changes. When you add a new API Operation run oas add, when you make changes run oas update. Optic precision patches your OpenAPI file with the same additions, updates, and removals you would manually write. It is faster and much less error-prone than writing OpenAPI by hand.

A collaborator, not a generator

Using the CLI to update your spec is like working with a collaborator. Get help writing all the boilerplate OpenAPI needed to sync your OpenAPI with the API's actual behaviors without giving up control or extensibility.

Never overwrites changes developers make to the same OpenAPI file

Respects $refs across multiple files

Improves accuracy of your specification

Speeds up your team

Using the CLI

First collect some traffic from your API using oas capture:

optic add openapi.yaml --proxy localhost:3000 localhost:3005

Then run oas openapi.yaml status:

oas openapi.yaml status

This command looks at your captured traffic and diffs it against your OpenAPI file. The output shows you any undocumented API Operations, or new behaviors it sees in API Operations already in the spec:

output...
...

...

If you want to add an API operation, use oas add to document it:

optic add openapi.yaml --proxy localhost:3000 localhost:3005

If you want to update an API operation, use oas update to patch it:

optic update openapi.yaml --proxy localhost:3000 localhost:3005

Capture Methods

Tutorials