Using the IBM z/OS Connect development tools for Visual Studio Code for an API project
How to use the z/OS Connect development tools for Visual Studio Code to generate the API provider language structures starting from an OpenAPI 2.0 document or an OpenAPI 3.0 document to call APIs from your z/OS applications.
Before you begin
zosConnect-3.0 Applies to zosConnect-3.0.
Started task Applies to z/OS Connect Servers run by using a z/OS started task procedure.
-
Install z/OS Connect development tools for Visual Studio Code. For more information, see Installing the IBM z/OS Connect development tools for Visual Studio Code extension.
-
Get the OpenAPI 2.0 document or the OpenAPI 3.0 document of the API that your z/OS application wants to call. The z/OS Connect development tools for Visual Studio Code uses the OpenAPI 2.0 document or the OpenAPI 3.0 document as an input to generate the API provider language structures to call the API. For more information about the generated artifacts, see Generating the language structures for an API provider.
-
To understand the supported OpenAPI 3.0 schemas, see OpenAPI 3.0 schemas supported by the Gradle plug-in.
- Ensure that you have access to Maven Central or the Gradle plug-in portal to be able to use the Gradle plug-in and its dependencies. Alternatively, ensure that the plug-in and dependencies are in a Maven repository that is hosted internally within your network.
-
When using the OpenAPI 2.0 specification, make sure that
consumesandproducesare defined either globally or at the operation level for any operations that include request or response payloads. -
If you build an API project in an offline (airgapped) environment, the required Gradle dependencies are available in the <installation_path>/dependencies.zip file as part of z/OS Connect. Expand this file on the build machine and use instead of a remote repository.
About this task
Follow these steps to generate the request and response language structures for a z/OS Connect API project by using z/OS Connect development tools for Visual Studio Code. When you have generated the request and response language structures, you then build the API project WAR by using the z/OS Connect API provider Gradle plug-in.
Procedure
Results
Several artifacts for the API project are created in the build subdirectory.
Your API project contains language structures for the request and response data structures of the APIs operations. The names of the generated request and response data structures is based on the providerPrefix value that is specified in the properties file.
For more information about the names of the generated artifacts, see The API provider Gradle plug-in properties and options for CICS.