Publishing an API
The user interface provides an option that adds an API to a Product and publishes the Product in a Catalog. Publishing a draft Product makes the APIs in that Product visible on the Developer Portal for use by application developers. The syndication feature in IBM® API Connect means that if Spaces are enabled for a Catalog, Products can be published only to a Space within that Catalog.
Before you begin
Ensure that you have a Catalog to stage to in the API Manager or API Designer user interfaces (UI). For more information, see Creating and configuring Catalogs.
Ensure that the Catalog has at least one gateway service configured.
To complete the Product management tasks that are described in this topic, you must either be the owner of the API provider organization, or be assigned Space. permission for the target Catalog or For information on configuring Product management permissions for a Catalog or Space, see Creating and configuring Catalogs or Managing user access in a Space.
About this task
You can complete this task either by using the API Designer UI application, or by using the browser-based API Manager UI. Publishing is not available when working offline in API Designer.
- Validation against the OpenAPI schema by using the API Dev Tools Swagger Parser (https://www.npmjs.com/package/@apidevtools/swagger-parser).
- Validation against IBM extension properties.
- Semantic validation, which includes the following types of validation:
- Ensuring that if an OpenAPI is enforced by an API Connect
Gateway, then the
scheme must be HTTPS, or the parameter name for an API key security scheme in the header must be
either
X-IBM-Client-Id
orX-IBM-Client-Secret
. - Ensuring that if the OpenAPI is not enforced by an
API Connect
Gateway, then a
host
must be provided. - De-referencing of local references in the definition file (that is, values of
$ref
properties), and ensuring these are valid JSON Pointers within the file.
- Ensuring that if an OpenAPI is enforced by an API Connect
Gateway, then the
scheme must be HTTPS, or the parameter name for an API key security scheme in the header must be
either
(?
" cannot be validated or published. An error
message is returned. For example:
Product has not been published!
The multipart 'openapi' field contains an OpenAPI definition with validation errors.
definitions.properties.pattern Does not match format 'regex' (context: (root).definitions.properties.pattern, line: 0, col: 0)
400
$ref
field to reference a fragment of OpenAPI code that is defined
in a separate file, the $ref
field is replaced
with the contents of the target file before the product that contains the API is staged or published
(the $ref
field is supported only if you are using the API Connect
developer toolkit). For more information, see Using $ref to
reuse code fragments in your OpenAPI
files.Procedure
Results
Your Product is published to a Catalog. You can view the state of the Product in the Catalog in API Manager. If you published the product from API Designer, ensure you are logged into API Manager with the same user name and password that you used for API Designer. Click Manage in the API Manager UI, then select the required Catalog. The Product is shown with a state of Published.
For information about the lifecycle of a product, see The Product lifecycle.
If approval is required to publish Products in the Catalog, a publish approval request is sent, and the Product moves to the Pending state; the Product is published in the Catalog when the request is approved. If approval is not required, the Product is published immediately.
For information on configuring Product lifecycle approvals for a Catalog, see Creating and configuring Catalogs. For information on approving requests, see Approving Product lifecycle and subscription requests.
If the Product contains no Plans, a Plan called Default Plan is added automatically to the Product in the Catalog.
- If an OpenAPI 3 API contains a response wildcard (which is not supported), publishing is disabled for that API. You must correct the problem before you can publish the API.
- If the Product contains an API that includes a user-defined policy that has not been imported into this Catalog, the publish will fail. The user-defined policy must be available in the required Catalog for the Product to be published successfully. For detailed instructions on how to import a user-defined policy into a Catalog, see Importing a user-defined policy into a Catalog.