Creating a REST API from an imported Swagger document

To create a REST API in IBM® Integration Bus, you can import a Swagger document by using the IBM Integration Toolkit.

Before you begin

Create a Swagger document that describes the resources and operations that you want in the REST API. Ensure that the Swagger document adheres to the guidelines in the Swagger specification, and that it satisfies the requirements of IBM Integration Bus. See the Swagger RESTful API Documentation Specification Version 2.0 and Restrictions on Swagger documents for information.

About this task

To create a REST API in IBM Integration Bus, you can use the Create a REST API wizard in the IBM Integration Toolkit to import a Swagger document. You must then create the REST API and other project artifacts that are required to implement and deploy the new REST API. Alternatively, you can create a REST API by defining the models, resources, and operations from scratch, as described in Creating a REST API from scratch by using the IBM Integration Toolkit.

Procedure

To create a REST API by importing a Swagger document, complete the following steps:

  1. Open the Create a REST API wizard by clicking File > New > REST API .
  2. Enter a name for the REST API.
    The name that you specify is used as the name of the project in the IBM Integration Toolkit.
  3. Select Import resources and operations defined in a Swagger document and then click Next.
  4. Select the path to the Swagger document that describes the resources and operations that you want in the REST API.
    You can import the Swagger document from the file system or from an existing project in the workspace.
    The file is validated for use in a REST API. If any errors are found while the selected Swagger document is validated, those validation errors are displayed at the top of the wizard. You cannot proceed if validation errors are found in the selected Swagger document.
  5. Optional: To review the list of resources and operations that are contained in the selected Swagger document, click Next.
  6. To finish creating the REST API, click Finish.
    The REST API Description for the new REST API opens automatically, which you can use to implement operations as described in Implementing an operation in a REST API.

Results

The REST API is created.

What to do next

Implement each of the operations in the REST API as a subflow, see Implementing an operation in a REST API.