Creating a new REST API that uses artifacts from an existing REST API

Deploy multiple versions of the same REST API simultaneously by copying REST API artifacts into a new REST API project.

Before you begin

You must create a REST API in the IBM® App Connect Enterprise Toolkit, see Creating a REST API.

About this task

To create multiple versions of the same REST API, you can copy artifacts from an existing REST API into a new REST API.

Note: If you want to deploy the new and existing REST APIs on the same integration server, you must specify a different base path for each of them. Use the Modify button (REST API modify button) in the REST API editor to modify the resource paths.

Procedure

To create a new REST API that uses artifacts from an existing REST API complete the following steps.

  1. Create a REST API project in the IBM App Connect Enterprise Toolkit.
    If the existing REST API project is in the currently open workspace, you must specify a different name for the new REST API project. If you modified the REST API project, modify the resource path by using the Modify button in the REST API editor.
  2. Open the REST API Description for the new REST API project.

Complete one of the following steps depending on whether you created the REST API with a Swagger document or an OpenAPI 3.0 document.

  1. Optional: In the REST API Description, implement operations and error handlers from the existing REST API project.
    1. for all operations that you want to implement, click the Implement the Operation link.
    2. If you created the REST API with a Swagger document, then for all error handlers that you want to implement, click the Implement the Error Handler link.
    This action creates the connections from the REST API project to the subflows.
    Note: Do not add any message flow nodes to the generated subflows.
  2. Optional: In the REST API Description, implement operations and error handlers from the existing REST API project.
    1. If you created the REST API with an OpenAPI 3.0 document, then for all operations that you want to implement, click the Create subflow button.
    2. If you created the REST API with an OpenAPI 3.0 document, then, for all error handlers that you want to implement, click the Create subflow button.
    This action creates the connections from the REST API project to the subflows.
    Note: Do not add any message flow nodes to the generated subflows.
  3. Copy the subflows for implemented operations and error handlers from the existing REST API project into the new REST API project.
    Copying subflows from the existing REST API overwrites the subflows that are generated in the previous step.
  4. Reference any static or shared libraries in the new REST API project that are referenced by the existing REST API, see Referencing resources in other libraries.
  5. Copy all other artifacts, for example, subflows, schemas, and maps, from the existing REST API project into the new REST API project.

Results

You have created a new REST API by reusing artifacts from an existing REST API.

What to do next

You must package and deploy your REST API to an integration server, see Packaging and deploying a REST API.