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
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
-
In your IDE, create a
Map<String, String>
object to contain the properties required to build the artifacts for the API requester. -
Create a
ARAGenerator
object passing in the Map created in Step 1.If any properties are invalid, anInvalidPropertyException
occurs. The error message contains the property in error and the reason. -
Save the .ara file.
Call the
save()
method and pass the filename. - 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");