Mapping to a REST API with the OpenAPI importer

The OpenAPI importer creates a type tree from an OpenAPI JSON document. Optionally, you can generate a sample map or sample Launcher system that hosts the API.

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 a Transformation Extender map to call 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.
    Type tree name
    Type a brief descriptive name for the 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..