Using Swagger to Create a REST Service

You can drag and drop a path from the Swagger file on to the left boundary of the Process Editor to create a REST service or drag it to the center and select Create Service from the resulting menu.

Note: When you create a REST service, make sure to edit the Default Host field in the HTTP Connection Resource to reflect the actual host name. By default, the Default Host field is set to localhost using the BW.HOST.NAME module property.
Note: When you use Swagger to create a REST service, the fields in the Bindings tab of the service properties display as read-only. Swagger is like a contract that must be followed exactly, so the service you create with the Swagger file cannot be modified.

To create a REST service from a Swagger file, do the following:

Procedure

  1. Create an empty project if you do not already have one. Refer to the topic "Developing a Basic Process" in the Application Development Guide.
  2. Import the Swagger JSON file into the Service Descriptors folder of your project by dragging and dropping it from either the API Modeler view (if the Swagger file resides in API Modeler) or the File Explorer view (if the Swagger file resides on your local drive).
  3. Expand the .json node that you just created under the Service Descriptors folder to view the available paths.
  4. Drag and drop a path from the Service Descriptors folder to the left side of the process editor to create a service or to the right side of the process editor to create a reference.
    TIBCO Business Studio™ automatically generates a corresponding XSD schema for the Swagger file in the Schemas folder.