Hosting a REST API with the OpenAPI importer via the Launcher

The OpenAPI importer creates a type tree from an OpenAPI JSON document. You can use the IBM Transformation Extender Launcher to host the API.

About this task

The type tree structure that is generated is very similar to the type tree that is created when you use a map to call the REST API. The difference is that for this type tree structure, there is no definition category to describe the JSON data. Instead, the JSON is expressed as a blob by using the httpPayload item.

Procedure

  1. Access the Importer Wizard in Design Studio.
  2. In the Import window, expand the Transformation Extender folder, select OpenAPI from the import source list, and click Next.
  3. Enter or select the name of the JSON file that you want to import, and click Next.
  4. Choose a path from the list to display the operations that are included in the path.
  5. Select the operation that you want to import to generate a type tree and adapter command line properties, and click Next.
  6. Select Use Transformation Extender Launcher to host the REST API, and click Next.
  7. Configure the API connection information and click Next.
    Scheme
    Select the security transfer protocol to use for the API connection.
    Host
    Specify the hostname and port of the HTTP listener in the format hostname:port.
    Base path
    Type the base path on which the API is served, which is relative to the host. If it is not included, the API is served directly under the host. The base path value must start with a leading forward slash (/).
    Produces
    Select the MIME types that the API can produce. This selection is global to all API calls but can be overridden on specific API calls.
  8. Specify the artifact that is generated.
    Folder name
    Specify the folder in which the artifact will be saved, or create a new folder.
    HTTP message type tree name
    Type a brief descriptive name for the message type tree. The format is filename-operationId.mtt.
    Note: If you do not specify an operationId, the HTTP operation is used.
    Data definitions type tree name
    Type a brief descriptive name for the data definitions type tree. The format is filename-operationId.mtt.
    Note: If you do not specify an operationId, the HTTP operation is used.
    HTTP adapter command
    Type the name of the file that contains the HTTP adapter command to run. The format is filename-operationIdHttpCommand.txt.
    Note: If you do not specify an operationId, the HTTP operation is used.
    Generate sample map source
    Click to enable the generation of a sample source map. The default is clear, which indicates that a sample map is not generated.
    Map source file
    If you enabled Generate sample map source, type the name of the sample map file that is generated. The format is filename-operationIdSampleMap.mms.
    Note: If you do not specify an operationId, the HTTP operation is used. Tip: The sample map allows you view everything that was generated. You can edit this map so it suits your purposes. The sample map contains three cards:
    httpRequest
    The first card includes that data you want to send to the REST API.
    execute
    The second card invokes the HTTP adapter by using the HTTP command generated by the importer, and using the information on the httpRequest card as the payload.
    httpResponse
    The third card parses the HTTP response to produce output that you can validate against the type tree that you created..
    Generate sample integration flow designer library (XML format)
    Click to enable the generation of a sample integration flow designer library in XML format. The default is not selected, which indicates that a sample integration flow designer library is not generated.
    XML library file
    If you enabled Generate sample integration flow designer library (XML format), type the name of the sample designer flow library that is generated. The format is filename-operationIdSampleSystem.xml.
    Note: If you do not specify an operationId, the HTTP operation is used.
    Tip: The XML library file is a metadata object that allows for more fine-tuned XML model definitions.
  9. Click Finish to generate the type tree and, if you chose to generate a sample map, generate the map.