Autocataloging APIs Using API Catalog CLI
API Catalog CLI enables you to discover and catalog your API definitions, documentation files, and associated metadata as part of an automated process. You can embed the publish asset command in your automation tools, such as a CI/CD pipeline or custom scripts, to automatically trigger the publishing of your API assets to Exchange. API Catalog CLI is agnostic of CI/CD tools and runtime environments.
With API Catalog CLI you can:
-
Identify all APIs in a project directory structure and create a descriptor file to use to publish the APIs to Exchange.
-
Identify all new and changed APIs and update the descriptor file on an ongoing basis.
-
Conditionally trigger the publish based on criteria such as branches and tags.
-
Conditionally set the asset version strategy based on criteria such as branches and tags.
-
Publish APIs described in the descriptor file by running commands either at a command prompt or as part of your CI/CD pipelines or custom scripts.
Supported APIs
The API Catalog CLI supports:
-
Event-driven APIs (AsyncAPI 2.0 JSON and AsyncAPI 2.0 YAML format)
-
REST APIs (OAS 2.0 JSON, OAS 2.0 YAML, OAS 3.0 JSON, OAS 3.0 YAML, RAML 0.8, and RAML 1.0 format)
API Catalog CLI Concepts
Review the following concepts before using API Catalog CLI.
Descriptor File
A descriptor file has the metadata Exchange needs to catalog a set of APIs within a directory and its subdirectory structure. This file’s schema supports metadata specific to API Catalog CLI and can include in-line or referenced metadata from exchange.json
files.