Generating artifacts for an API requester with the build toolkit SDK

Use the build toolkit SDK to build your artifacts for the API requester.

Before you begin

Ensure that the IBM® z/OS® Connect build toolkit is installed. For more information, see Installing the IBM z/OS Connect build toolkit.

About this task

Follow these steps to use the IBM z/OS Connect build toolkit SDK to generate the API information file, data structures and API requester archive for a z/OS application to call a RESTful API. To learn more about the build toolkit, see The IBM z/OS Connect build toolkit.

Procedure

  1. In your IDE, create a Map<String, String> object to contain the properties required to build the artifacts for the API requester.
  2. Create a ARAGenerator object passing in the Map created in Step 1.
    If any properties are invalid, an InvalidPropertyException occurs. The error message contains the property in error and the reason.
  3. Save the .ara file.
    Call the save() method and pass the filename.
  4. You can now deploy the .ara file to IBM z/OS Connect .

Example


Map<String, String> properties = new HashMap<String, String>();
       properties.put("apiDescriptionFile", "swagger.json");
       properties.put("dataStructuresLocation", "/tmp");
       properties.put("apiInfoFileLocation", "/tmp");
       properties.put("requesterPrefix", "API");
       properties.put("connectionRef", "test");
       properties.put("logFileDirectory", "/tmp");
       properties.put("language", "COBOL");

ARAGenerator araGenerator = new ARAGenerator(properties);
       araGenerator.save("/example/ouput/dir/file.ara");