Command argumentsAll commands accept the these same arguments.
One of the design decisions with
openapi-changes was to focus on making it a pure renderer for data
captured by libopenapi. In other words, openapi-changes is a front-end for
libopenapi, and it comes in four exciting flavours:
- A handy Terminal UI
- A very sexy and unique Browser UI
- A CI/CD friendly Summary Report
- A machine-readable JSON Report
The important thing to remember with all four flavors:
They all accept the same arguments.
Local git repository history
If the OpenAPI spec is located in a git repository on the local file system, use two arguments to a command. The first argument is the path to the git repository, and the second argument is the path to the OpenAPI spec file within the repository.
For example if the full path to a spec is:
The git repository path is:
/home/pb33f/corp-code and the path to the spec file is:
Some examples:Running from the root of a git repo
Github repository history
If the OpenAPI spec is located in a git repository on Github, use a single argument, The URL to the spec file on github.
Some examples:OpenAPI Petstore OpenAPI spec
Left and Right file comparison
If you have two OpenAPI files and no github or local git repo available, you can compare a left (original) and a right (modified) pair of OpenAPI specs. This reduces the ‘history’ feature of the tool down to a single commit, but other than that, everything else works, looks and operates the same.
Supply two arguments to any command, both being paths to OpenAPI spec files.Left and right file comparison
If you have an OpenAPI spec that has unresolved references (
$ref) to external files or remote locations in URLs,
then you can use the
--base flag to specify a base URL or base working directory to use for relative references.
For example if your references are to local files in the same directory, you can use the
--base flag to specify
the working directory.
If all the references are remote, then use a URL instead:Unresolved references
There are two flags that can be used to further customize
||Disable all color output and all terminal styling (useful for CI/CD)|
||Only show the latest changes (the last git revision against HEAD)|
||Limit the number of changes to show when using git|
||Base URL or Base working directory to use for relative references|
For example, to see just the latest changes: