A Swagger file is provided for viewing and testing Harbor REST API.
Viewing Harbor REST API
Open the file swagger.yaml under the docs directory in Harbor project
Paste all its content into the online Swagger Editor at http://editor.swagger.io. The descriptions of Harbor API will be shown on the right pane of the page.
Testing Harbor REST API
From time to time, you may need to mannually test Harbor REST API. You can deploy the Swagger file into Harbor’s service node. Suppose you install Harbor through online or offline installer, you should have a Harbor directory after you un-tar the installer, such as ~/harbor.
When using Swagger to send REST requests to Harbor, you may alter the data of Harbor accidentally. For this reason, we do not recommended using Swagger against a production Harbor instance.
Download prepare-swagger.sh and swagger.yaml under the docs directory to your local Harbor directory, e.g. ~/harbor.