Add Functionality to an Adapter Definition Document

After you've successfully added and tested one functionality to your adapter, you can add support for another API request.

  1. For Postman Collections, perform the following steps:

    Note:

    To update an adapter definition document with a new API request, you must first add the new request to your Postman collection, and export the collection to your workspace. See Create a Postman Collection Using API Requests.
    1. In VS Code, click Explorer Explorer icon on the sidebar.
      The directory structure of your workspace folder is displayed.
    2. Within the misc directory listing, right-click the updated collection file, and then click RAB: Add Requests from Postman Collection.
    3. In the Select request(s) pane, select the new request to add, and click Done.
  2. For OpenAPI documents, perform the following steps:
    1. Import the updated OpenAPI document into the api directory of your workspace folder.
    2. In VS Code, click Explorer Explorer icon on the sidebar.
      The directory structure of your workspace folder is displayed.
    3. Within the api directory listing, right-click the updated OpenAPI document you imported, and click Rename.
      Rename the updated document as openapi.resource.json.

      Note:

      You may not have to rename the document if you are using the same OpenAPI document imported earlier to select new requests.
    4. Right-click the document again, and then click RAB: Update actions with OpenAPI document.
    5. In the Select request(s) pane, select the new request to add, and click Done.
      Note that you can add new requests as well as remove requests that you had converted earlier by unchecking them. A summary of your selection is displayed at the top of the pane.
  3. In the dialog box that appears, select either of the following options based on what you had chosen while converting the original Postman collection (or OpenAPI document) into an adapter definition document. See Generate an Adapter Definition Document.
    • If you had chosen to use the main document (main.add.json) earlier, click Update main to add the new request to the same document.
    • If you aren't using the main document, click Save new.

    Note:

    If you choose Save new, the extension generates a new document and saves it in the definitions directory of your workspace. You can then rename this new document (containing updated requests) with the name of your earlier document to replace it.
    Now, the VS Code extension adds the new request to the document you select.
  4. Press Ctrl+S on your keyboard to save the document.